* Re: [PATCH] mm: fix page_mkclean_one [not found] <1170369622.3453.72.camel@garangu> @ 2007-02-02 8:42 ` Nick Piggin 2007-02-02 13:08 ` Evgeniy Polyakov 0 siblings, 1 reply; 2+ messages in thread From: Nick Piggin @ 2007-02-02 8:42 UTC (permalink / raw) To: Mark Groves; +Cc: linux-kernel, netdev Mark Groves wrote: > Hi, > > > I have been been seeing a problem when using sendfile repeatedly on an > SMP server, which I believe is related to the problem that was > discovered recently with marking dirty pages. The bug, as well as a test > script, is listed at http://bugzilla.kernel.org/show_bug.cgi?id=7650. > Currently, we're experiencing errors where part of a previous packet is > being sent out rather than the current packet. > > I have applied the patch Linus posted to a 2.6.19 kernel but am still > getting the problem. So I am wondering if there are any other places in > the kernel which mark pages as dirty which might require a similar > patch? Your issue is not related, firstly because the page_mkclean bug did not exist before 2.6.19 kernels. Anyway, I had a look at your bugzilla test-case and managed to slim it down to something that easily shows what the problem is (available on request) -- the problem is that recipient of the sendfile is seeing modifications that occur to the source file _after_ the sender has completed the sendfile, because the file pages are not copied but queued. I think the usual approach to what you are trying to do is to set TCP_CORK, then write(2) the header into the socket, then sendfile directly from the file you want. Another approach I guess is to implement an ack in your userland protocol so you do not modify the sendfile source file until the client acks that it has all the data. I'm not sure if there are any other usual ways to do this (ie. a barrier for sendfile, to ensure it will not pick up "future" modifications to the file). netdev cc'ed, someone there might have additional comments. Please close this bug if/when you are satisfied it is not a kernel problem. Thanks, Nick -- SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: fix page_mkclean_one 2007-02-02 8:42 ` [PATCH] mm: fix page_mkclean_one Nick Piggin @ 2007-02-02 13:08 ` Evgeniy Polyakov 0 siblings, 0 replies; 2+ messages in thread From: Evgeniy Polyakov @ 2007-02-02 13:08 UTC (permalink / raw) To: Nick Piggin; +Cc: Mark Groves, linux-kernel, netdev On Fri, Feb 02, 2007 at 07:42:52PM +1100, Nick Piggin (nickpiggin@yahoo.com.au) wrote: > Anyway, I had a look at your bugzilla test-case and managed to slim it > down to something that easily shows what the problem is (available on > request) -- the problem is that recipient of the sendfile is seeing > modifications that occur to the source file _after_ the sender has > completed the sendfile, because the file pages are not copied but > queued. > > I think the usual approach to what you are trying to do is to set TCP_CORK, > then write(2) the header into the socket, then sendfile directly from the > file you want. > > Another approach I guess is to implement an ack in your userland protocol > so you do not modify the sendfile source file until the client acks that > it has all the data. Mark, don't you use e1000 or other scatter-gather capable nic with checksum offload? Likely yes. Actual data sucking in that case happens when packet is supposed to be transmitted by the NIC, not when sendfile() is returned. The same applies to the case, when you have fancy egress filtering. It is not allowed to modify pages until they are really transmitted, if you want data integrity. There are _no_ bugs in network or VFS cache in this test case. > I'm not sure if there are any other usual ways to do this (ie. a barrier > for sendfile, to ensure it will not pick up "future" modifications to the > file). netdev cc'ed, someone there might have additional comments. > > Please close this bug if/when you are satisfied it is not a kernel problem. > > Thanks, > Nick > > -- > SUSE Labs, Novell Inc. > Send instant messages to your online friends http://au.messenger.yahoo.com -- Evgeniy Polyakov ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-02 13:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1170369622.3453.72.camel@garangu>
2007-02-02 8:42 ` [PATCH] mm: fix page_mkclean_one Nick Piggin
2007-02-02 13:08 ` Evgeniy Polyakov
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).