Reduce max trim request size to 512K

512K is the maximum request size for which request map
fits into one page (4K) regardless of cacheline size.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski 2020-02-10 15:21:16 -05:00
parent 3eadffad0f
commit 26fd938ccf
2 changed files with 4 additions and 1 deletions

View File

@ -352,6 +352,6 @@ typedef enum {
* @}
*/
#define MAX_TRIM_RQ_SIZE (1 * MiB)
#define MAX_TRIM_RQ_SIZE (512 * KiB)
#endif /* __OCF_DEF_H__ */

View File

@ -224,6 +224,9 @@ int ocf_req_alloc_map(struct ocf_request *req)
int ocf_req_alloc_map_discard(struct ocf_request *req)
{
ENV_BUILD_BUG_ON(MAX_TRIM_RQ_SIZE / ocf_cache_line_size_4 *
sizeof(struct ocf_map_info) > 4 * KiB);
if (req->byte_length <= MAX_TRIM_RQ_SIZE)
return ocf_req_alloc_map(req);