| To: | "Darrick J. Wong" <darrick.wong@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] vfs: cap dedupe request structure size at PAGE_SIZE |
| From: | Mark Fasheh <mfasheh@xxxxxxx> |
| Date: | Mon, 1 Aug 2016 19:35:07 -0700 |
| Cc: | Al Viro <viro@xxxxxxxxxxxxxxxxxx>, linux-api@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <20160728183534.GB15753@xxxxxxxxxxxxxxxx> |
| Organization: | SUSE Labs |
| References: | <20160728183534.GB15753@xxxxxxxxxxxxxxxx> |
| Reply-to: | Mark Fasheh <mfasheh@xxxxxxx> |
| User-agent: | Mutt/1.5.21 (2010-09-15) |
On Thu, Jul 28, 2016 at 11:35:34AM -0700, Darrick J. Wong wrote: > Kirill A. Shutemov reports that the kernel doesn't try to cap dest_count > in any way, and uses the number to allocate kernel memory. This causes > high order allocation warnings in the kernel log if someone passes in a > big enough value. We should clamp the allocation at PAGE_SIZE to avoid > stressing the VM. > > The two existing users of the dedupe ioctl never send more than 120 > requests, so we can safely clamp dest_range at PAGE_SIZE, because with > 4k pages we can handle up to 127 dedupe candidates. Given the max > extent length of 16MB, we can end up doing 2GB of IO which is plenty. > > Reported-by: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Reviewed-by: Mark Fasheh <mfasheh@xxxxxxx> -- Mark Fasheh |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | 2016-08-01 16:42:30hoist ring factory, rigging1@xxxxxxxx |
|---|---|
| Next by Date: | [PATCH] xfs: in _attrlist_by_handle, copy the cursor back to userspace, Darrick J. Wong |
| Previous by Thread: | Re: [PATCH] vfs: cap dedupe request structure size at PAGE_SIZE, Christoph Hellwig |
| Next by Thread: | Re: xfs_icache.c:1298]: (style) Redundant condition, Christoph Hellwig |
| Indexes: | [Date] [Thread] [Top] [All Lists] |