[lkml]   [2017]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer message with data payload
On Wed, Aug 30, 2017 at 02:17:56AM +0000, Long Li wrote:
> I partially addressed this issue in the V3 patch. Most of the duplicate
> code on sending path is merged.
> The difficulty with translating the buffer to pages is that: I don't
> know how many pages will be translated, and how many struct page I need
> to allocate in advance to hold them. I try to avoid memory allocation
> in the I/O path as much as possible. So I keep two functions of
> sending data: one for buffer and one for pages.

You do: you'll always need speace for (len + PAGE_SIZE - 1) >> PAGE_SIZE

That being said: what callers even send you buffers? In general we
should aim to work with pages for all allocations that aren't tiny.

 \ /
  Last update: 2017-08-30 10:52    [W:0.089 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site