From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751520AbdBWSys (ORCPT ); Thu, 23 Feb 2017 13:54:48 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:36900 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbdBWSyr (ORCPT ); Thu, 23 Feb 2017 13:54:47 -0500 Date: Thu, 23 Feb 2017 13:22:06 -0500 From: Johannes Weiner To: Shaohua Li Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kernel-team@fb.com, mhocko@suse.com, minchan@kernel.org, hughd@google.com, riel@redhat.com, mgorman@techsingularity.net, akpm@linux-foundation.org Subject: Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list Message-ID: <20170223182206.GA5686@cmpxchg.org> References: <20170223155827.GB4031@cmpxchg.org> <20170223162601.GA18526@brenorobert-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170223162601.GA18526@brenorobert-mbp.dhcp.thefacebook.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 23, 2017 at 08:26:03AM -0800, Shaohua Li wrote: > On Thu, Feb 23, 2017 at 10:58:27AM -0500, Johannes Weiner wrote: > > Hi Shaohua, > > > > On Wed, Feb 22, 2017 at 10:50:41AM -0800, Shaohua Li wrote: > > > @@ -268,6 +268,12 @@ static void __activate_page(struct page *page, struct lruvec *lruvec, > > > int lru = page_lru_base_type(page); > > > > > > del_page_from_lru_list(page, lruvec, lru); > > > + if (PageAnon(page) && !PageSwapBacked(page)) { > > > + SetPageSwapBacked(page); > > > + /* charge to anon scanned/rotated reclaim_stat */ > > > + file = 0; > > > + lru = LRU_INACTIVE_ANON; > > > + } > > > > As per my previous feedback, please remove this. Write-after-free will > > be caught and handled in the reclaimer, read-after-free is a bug that > > really doesn't require optimizing page aging for. And we definitely > > shouldn't declare invalid data suddenly valid because it's being read. > > GUP could run into this. Don't we move the page because it's hot? I think it's > not just about page aging. If we leave the page there, page reclaim will just > waste time to reclaim the pages which should't be reclaimed. There is just no convincing justification to add this code, because it optimizes something that doesn't have a real world application. If we just delete this branch, for all intents and purposes the outcome will be perfectly acceptable. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f70.google.com (mail-wm0-f70.google.com [74.125.82.70]) by kanga.kvack.org (Postfix) with ESMTP id 8CBED6B0038 for ; Thu, 23 Feb 2017 13:28:03 -0500 (EST) Received: by mail-wm0-f70.google.com with SMTP id x4so3497382wme.3 for ; Thu, 23 Feb 2017 10:28:03 -0800 (PST) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id v15si7062554wra.112.2017.02.23.10.28.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Feb 2017 10:28:02 -0800 (PST) Date: Thu, 23 Feb 2017 13:22:06 -0500 From: Johannes Weiner Subject: Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list Message-ID: <20170223182206.GA5686@cmpxchg.org> References: <20170223155827.GB4031@cmpxchg.org> <20170223162601.GA18526@brenorobert-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170223162601.GA18526@brenorobert-mbp.dhcp.thefacebook.com> Sender: owner-linux-mm@kvack.org List-ID: To: Shaohua Li Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kernel-team@fb.com, mhocko@suse.com, minchan@kernel.org, hughd@google.com, riel@redhat.com, mgorman@techsingularity.net, akpm@linux-foundation.org On Thu, Feb 23, 2017 at 08:26:03AM -0800, Shaohua Li wrote: > On Thu, Feb 23, 2017 at 10:58:27AM -0500, Johannes Weiner wrote: > > Hi Shaohua, > > > > On Wed, Feb 22, 2017 at 10:50:41AM -0800, Shaohua Li wrote: > > > @@ -268,6 +268,12 @@ static void __activate_page(struct page *page, struct lruvec *lruvec, > > > int lru = page_lru_base_type(page); > > > > > > del_page_from_lru_list(page, lruvec, lru); > > > + if (PageAnon(page) && !PageSwapBacked(page)) { > > > + SetPageSwapBacked(page); > > > + /* charge to anon scanned/rotated reclaim_stat */ > > > + file = 0; > > > + lru = LRU_INACTIVE_ANON; > > > + } > > > > As per my previous feedback, please remove this. Write-after-free will > > be caught and handled in the reclaimer, read-after-free is a bug that > > really doesn't require optimizing page aging for. And we definitely > > shouldn't declare invalid data suddenly valid because it's being read. > > GUP could run into this. Don't we move the page because it's hot? I think it's > not just about page aging. If we leave the page there, page reclaim will just > waste time to reclaim the pages which should't be reclaimed. There is just no convincing justification to add this code, because it optimizes something that doesn't have a real world application. If we just delete this branch, for all intents and purposes the outcome will be perfectly acceptable. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org