From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BB11C3F2C6 for ; Tue, 10 Mar 2020 00:45:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0B393205F4 for ; Tue, 10 Mar 2020 00:45:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YEFO+g1F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B393205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9DB136B0081; Mon, 9 Mar 2020 20:45:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 98F1C6B0083; Mon, 9 Mar 2020 20:45:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87C486B0085; Mon, 9 Mar 2020 20:45:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 6E7FA6B0081 for ; Mon, 9 Mar 2020 20:45:58 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 05EE9180AD811 for ; Tue, 10 Mar 2020 00:45:58 +0000 (UTC) X-FDA: 76577610396.01.feast69_16f0f873eb758 X-HE-Tag: feast69_16f0f873eb758 X-Filterd-Recvd-Size: 5217 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Mar 2020 00:45:57 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id u12so5489182pgb.10 for ; Mon, 09 Mar 2020 17:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=26QsCB8W83s8I0/JuIlZZ4BURVVZW5a1bWPwo7lVEF8=; b=YEFO+g1Fryj2bQJ1ggse9nsi1GsB+dcble75kP3KrLOHB2uV1mhRnz3bbx8H0KXz0K hSmZYyyRhqMvE63wtsDTtiokcjRjaM5YMUez6F1TzKTSTJfJBEklrRSR6XJa1cak/XOO lV567K0ydDBlO23NRF98f4M2Eh3T2ETgN98JNKe9BGzBnHBkuSPxtcX2opWCzulaSxom u94se0Dd9DOJ7jGkafF62sKsj3YA92lGFL4gQO15+SURUjjSxFEFt8KeEyXNST4QNT2R UoeBxtNtfYMjxnwqViEHMXPsAnfW0vTmC/LBqGRMd1zQ2miSbcJNePX95apqglmRu8bs 1M2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=26QsCB8W83s8I0/JuIlZZ4BURVVZW5a1bWPwo7lVEF8=; b=qNN0jvRiNfm16HNwTIxptIw5mDm5wML4RPEbwLnwpj7SZ7FpIDcPcjwqtSuutuXMvN 5AD0NMrYByoMp3fzxhSUHPtZT7+ijpvoSK0wgRmrSGXzucXJ32ShgbxyZJOLUnPTEe/F 8V4SO0IliEO+2UPQsdbqDX0l8SQFZikMTNbHUXMBjbSiYp1mmVU5pl7vJjc5vVMulz6e a8yqp/X+sNeUzg6CMwPRlLLx7amNYws7aq7LGjke50ySGWdNSfdInRTyjwU9dfrQPOYP OZ5VPNxWV25Gjkm/CLtFYqTO3YXPNGktJMOeYkBRLbKCUrBrnyb++jW0Jxy2q2uE6A7l AfJA== X-Gm-Message-State: ANhLgQ0XsaGVlSfTQJKhqw5m/HUr7tM1MrsPSkH/Hb8B1kXZuhB7SW24 pc66cgCGlXb2pnbhN32/sCywbg== X-Google-Smtp-Source: ADFU+vuwuJ8ePui0lmm2cyIBXH4Y6kAbKWJ1cgus8VGl1+v9lo4BIUf7qJuZJuj9WNhaTzlkrNSTlQ== X-Received: by 2002:a65:6495:: with SMTP id e21mr18198524pgv.420.1583801156413; Mon, 09 Mar 2020 17:45:56 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id g7sm650857pjl.17.2020.03.09.17.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 17:45:55 -0700 (PDT) Date: Mon, 9 Mar 2020 17:45:53 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: David Hildenbrand cc: "Huang, Ying" , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Hansen , Mel Gorman , Vlastimil Babka , Zi Yan , Michal Hocko , Peter Zijlstra , Minchan Kim , Johannes Weiner , Hugh Dickins Subject: Re: [PATCH -V3] mm: Add PageLayzyFree() helper functions for MADV_FREE In-Reply-To: <23076072-7875-cabf-768f-ce27cba3480d@redhat.com> Message-ID: References: <20200309021744.1309482-1-ying.huang@intel.com> <68360241-eb18-b3d8-bf6f-4dbbed258ee6@redhat.com> <87r1y1yjll.fsf@yhuang-dev.intel.com> <23076072-7875-cabf-768f-ce27cba3480d@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 9 Mar 2020, David Hildenbrand wrote: > >> I still prefer something like > >> > >> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h > >> index fd6d4670ccc3..7538501230bd 100644 > >> --- a/include/linux/page-flags.h > >> +++ b/include/linux/page-flags.h > >> @@ -63,6 +63,10 @@ > >> * page_waitqueue(page) is a wait queue of all tasks waiting for the page > >> * to become unlocked. > >> * > >> + * PG_swapbacked used with anonymous pages (PageAnon()) indicates that a > >> + * page is backed by swap. Anonymous pages without PG_swapbacked are > >> + * pages that can be lazily freed (e.g., MADV_FREE) on demand. > >> + * > >> * PG_uptodate tells whether the page's contents is valid. When a read > >> * completes, the page becomes uptodate, unless a disk I/O error happened. > >> * > > > > Why not just send a formal patch? So Andrew can just pick anything he > > likes. I am totally OK with that. > > Because you're working on cleaning this up. > > > > >> and really don't like the use of !__PageLazyFree() instead of PageSwapBacked(). > > > > If adopted, !__PageLazyFree() should only be used in the context where > > we really want to check whether pages are freed lazily. Otherwise, > > PageSwapBacked() should be used. > > > > Yeah, and once again, personally, I don't like this approach. E.g., > ClearPageLazyFree() sets PG_swapbacked. You already have to be aware > that this is a single flag being used in the background and what the > implications are. IMHO, in no way better than the current approach. I > prefer better documentation instead. > Fully agreed.