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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 17657C10F27 for ; Mon, 9 Mar 2020 02:15:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DCF1A20665 for ; Mon, 9 Mar 2020 02:15:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCF1A20665 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6F2FE6B0003; Sun, 8 Mar 2020 22:15:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A3E06B0006; Sun, 8 Mar 2020 22:15:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B8D66B0007; Sun, 8 Mar 2020 22:15:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 41A3E6B0003 for ; Sun, 8 Mar 2020 22:15:30 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id F1713180AD80F for ; Mon, 9 Mar 2020 02:15:29 +0000 (UTC) X-FDA: 76574207178.28.print59_12d3e76cdbd2c X-HE-Tag: print59_12d3e76cdbd2c X-Filterd-Recvd-Size: 3008 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Mar 2020 02:15:29 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2020 19:15:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,530,1574150400"; d="scan'208";a="230774999" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga007.jf.intel.com with ESMTP; 08 Mar 2020 19:15:23 -0700 From: "Huang\, Ying" To: David Rientjes Cc: David Hildenbrand , Andrew Morton , , , Dave Hansen , Mel Gorman , Vlastimil Babka , Zi Yan , Michal Hocko , Peter Zijlstra , Minchan Kim , Johannes Weiner , Hugh Dickins Subject: Re: [PATCH -V2] mm: Add PageLayzyFree() helper functions for MADV_FREE References: <20200304081732.563536-1-ying.huang@intel.com> <87y2sf1ki1.fsf@yhuang-dev.intel.com> Date: Mon, 09 Mar 2020 10:15:22 +0800 In-Reply-To: (David Rientjes's message of "Fri, 6 Mar 2020 12:41:32 -0800") Message-ID: <87eeu2z32d.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=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: David Rientjes writes: > On Thu, 5 Mar 2020, Huang, Ying wrote: > >> > In general, I don't think this patch really improves the situation ... >> > it's only a handful of places where this change slightly makes the code >> > easier to understand. And there, only slightly ... I'd prefer better >> > comments instead (e.g., in PageAnon()), documenting what it means for a >> > anon page to either have PageSwapBacked() set or not. >> >> Personally, I still prefer the better named functions than the comments >> here and there. But I can understand that people may have different >> flavor. >> > > Maybe add a comment to page-flags.h referring to what PageSwapBacked > indicates when PageAnon is true? If someone find a confusing PageSwapBacked() invocation, and if we only want to use comments to resolve the confusing, the best place to add the comments is above the line where PageSwapBacked() is invoked. Because it's harder for people to dig out the right comments in page-flags.h. The appropriate named helper functions can replace that comments and be more elegant. Best Regards, Huang, Ying