Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752155AbZL3RDm (ORCPT ); Wed, 30 Dec 2009 12:03:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751683AbZL3RDl (ORCPT ); Wed, 30 Dec 2009 12:03:41 -0500 Received: from mk-filter-4-a-1.mail.uk.tiscali.com ([212.74.100.55]:9056 "EHLO mk-filter-4-a-1.mail.uk.tiscali.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbZL3RDl (ORCPT ); Wed, 30 Dec 2009 12:03:41 -0500 X-Trace: 313817291/mk-filter-4.mail.uk.tiscali.com/B2C/$b2c-THROTTLED-DYNAMIC/b2c-CUSTOMER-DYNAMIC-IP/79.69.28.176/None/hugh.dickins@tiscali.co.uk X-SBRS: None X-RemoteIP: 79.69.28.176 X-IP-MAIL-FROM: hugh.dickins@tiscali.co.uk X-SMTP-AUTH: X-Originating-Country: GB/UNITED KINGDOM X-MUA: Alpine 2.00 (LSU 1167 2008-08-23) X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQBAM8WO0tPRRyw/2dsb2JhbAAIy04Ii1uCQQiBaAQ X-IronPort-AV: E=Sophos;i="4.47,476,1257120000"; d="scan'208";a="313817291" Date: Wed, 30 Dec 2009 17:03:31 +0000 (GMT) From: Hugh Dickins X-X-Sender: hugh@sister.anvils To: Minchan Kim cc: Rik van Riel , Andrew Morton , lkml , linux-mm , KOSAKI Motohiro Subject: Re: [PATCH -mmotm-2009-12-10-17-19] Prevent churning of zero page in LRU list. In-Reply-To: <20091228130926.6874d7b2.minchan.kim@barrios-desktop> Message-ID: References: <20091228115315.76b1ecd0.minchan.kim@barrios-desktop> <4B38246C.3020209@redhat.com> <20091228130926.6874d7b2.minchan.kim@barrios-desktop> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2766 Lines: 66 On Mon, 28 Dec 2009, Minchan Kim wrote: > On Sun, 27 Dec 2009 22:22:20 -0500 > Rik van Riel wrote: > > On 12/27/2009 09:53 PM, Minchan Kim wrote: > > > > > > VM doesn't add zero page to LRU list. > > > It means zero page's churning in LRU list is pointless. > > > > > > As a matter of fact, zero page can't be promoted by mark_page_accessed > > > since it doesn't have PG_lru. > > > > > > This patch prevent unecessary mark_page_accessed call of zero page > > > alghouth caller want FOLL_TOUCH. > > > > > > Signed-off-by: Minchan Kim > > > > The code looks correct, but I wonder how frequently we run into > > the zero page in this code, vs. how much the added cost is of > > having this extra code in follow_page. > > > > What kind of problem were you running into that motivated you > > to write this patch? > > I didn't have experienced any problem in this case. > In fact, I found that while trying to make patch smap_pte_change. > > Long time ago when we have a zero page, we regards it to file_rss. > So while we see the smaps, vm_normal_page returns zero page and we can > calculate it properly with PSS. > > But now we don't acccout zero page to file_rss. > I am not sure we have to account it with file_rss. > So I think now smaps_pte_range's resident count routine also is changed. > > Anyway, I think my patch doesn't have much cost since many customers of > follow_page are already not a fast path. > > I tend to agree with your opinion "How frequently we runt into the zero page?" > But my thought GUP is export function which can be used for anything by anyone. > > Thanks for the review, Rik. I'm guessing that you've now dropped the idea of this patch, since it wasn't included along with your 1/3, 2/3, 3/3. You thought the ZERO_PAGE was moving around the LRUs, but now realize that it isn't, so accept there's no need for this patch? There's lots of places where we could shave a little time off dealing with the ZERO_PAGE by adding tests for it; but at the expense of adding code to normal paths of the system, slowing them down. If there's a proven reason for doing so somewhere, yes, we should add such tests to avoid significant cacheline bouncing; but without good reason, we just let ZERO_PAGEs fall through the code as they do. I believe that get_user_pages() on ZERO_PAGEs is exceptional, beyond the cases of coredumping and mlock and make_pages_present; but if you've evidence for adding a test somewhere, please provide it. Hugh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/