linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* stable page writes: wait_on_page_writeback and packet signing
@ 2011-03-09 19:44 Steve French
       [not found] ` <AANLkTinFx9KGKDWSdUvFSvT4S6f9QjBzX=6Uo17oO89+-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 25+ messages in thread
From: Steve French @ 2011-03-09 19:44 UTC (permalink / raw)
  To: linux-cifs-u79uwXL29TY76Z2rM5mHXA, linux-fsdevel
  Cc: Mingming Cao, Jeff Layton

Following up on the discussion about how to avoid the copy into a
temporary buffer for the case when a file system has to sign a page
(or list of pages) that is going to be passed in an iovec to be
written to the network or disk, I noticed that a few file systems do
issue wait_on_page_writeback (nfs in nfs_writepages for example).
Apparently some areas are being investigated to add something similar
for ext4 for disk adapters that do crc checks on data being sent down
to the disk.   In the cifs case it looks like cifs_writepages already
does:

if (wbc->sync_mode != WB_SYNC_NONE)
                                wait_on_page_writeback(page);


(before sending the list of pages to CIFSSMBWrite2 in fs/cifs/file.c)
and does the end_page_writeback if the write to the server succeeds.
The problem is that when packet signing is enabled we default to
issuing the older CIFSSMBWrite (which will allocate a temporary
buffer, and copy the pages being written into it to make sure the data
being written is stable while calculating the CRC on the packet, which
hurts performance).  It seems like we can simply move the equivalent
of the following check:

if (pTcon->ses->server->sec_mode &
    (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))

to add to the existing check for WB_SYNC
if (wbc->sync_mode != WB_SYNC_NONE)
                                wait_on_page_writeback(page);

We would have to add an end_page_writeback earlier though (after the
network i/o is successfully submitted to the network and sent, not
when the server response is received) to avoid holding up page writes
overly long - but only for the case where WB_SYNC_NONE and signing
enabled/required.

Have alternative approaches, other than using wait_on_page_writeback,
been considered for solving the stable page write problem in similar
cases (since only about 1 out of 5 linux file systems uses this call
today).

-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-03-11 16:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 19:44 stable page writes: wait_on_page_writeback and packet signing Steve French
     [not found] ` <AANLkTinFx9KGKDWSdUvFSvT4S6f9QjBzX=6Uo17oO89+-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-09 21:51   ` Dave Chinner
2011-03-09 21:58     ` Chris Mason
2011-03-09 22:13       ` Steve French
     [not found]         ` <AANLkTikK8MOm-m9XsOA4YGRe=E9bJTDh4iEYXtZumNmv-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-10 12:26           ` Chris Mason
2011-03-10 13:16             ` Jeff Layton
     [not found]               ` <20110310081638.0f8275d4-xSBYVWDuneFaJnirhKH9O4GKTjYczspe@public.gmane.org>
2011-03-10 13:32                 ` Chris Mason
2011-03-10 13:47                   ` Jeff Layton
     [not found]                     ` <20110310084724.658fe5d7-xSBYVWDuneFaJnirhKH9O4GKTjYczspe@public.gmane.org>
2011-03-10 13:58                       ` Chris Mason
2011-03-11 12:11                         ` Jeff Layton
     [not found]                           ` <20110311071143.01b407b6-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2011-03-11 12:56                             ` Chris Mason
2011-03-11 13:42                               ` Jeff Layton
     [not found]                                 ` <20110311084221.4ac6bd11-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2011-03-11 16:00                                   ` Chris Mason
2011-03-09 23:46       ` Dave Chinner
2011-03-09 22:01     ` Steve French
2011-03-09 23:54       ` Jeff Layton
     [not found]         ` <20110309185427.7858c29b-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-03-10  0:33           ` Steve French
     [not found]             ` <AANLkTi=pXHjE6tNMm0_nO=Cn3nGH8oZ6Xhm1STh8x1Xe-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-10  1:30               ` Jeff Layton
2011-03-10 13:53                 ` Steve French
     [not found]                 ` <20110309203044.4fd0498e-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-03-11 11:53                   ` Jeff Layton
     [not found]       ` <AANLkTinDmqah6pQnHugoVxh-gDq+6+MDMuh-TyVAQ7LP-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-10  1:41         ` Trond Myklebust
     [not found]           ` <1299721264.2976.3.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2011-03-10  7:34             ` Christoph Hellwig
2011-03-10 13:44             ` Steve French
2011-03-09 23:45     ` Jeff Layton
2011-03-10  2:12       ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).