Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2006700ybh; Sun, 8 Mar 2020 19:22:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsmNSfVbeqOUIw582o1c4p6730s4zs+NrqJeW/kEaTLmXlJ6evqWdBQ60PwOi1esRSaSNex X-Received: by 2002:a05:6830:1313:: with SMTP id p19mr8011179otq.126.1583720555739; Sun, 08 Mar 2020 19:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583720555; cv=none; d=google.com; s=arc-20160816; b=K3qyES2jWym6GUz+mnzXZtlimtluDqwwMmpT9V//I+cHWGSSx3y/y/thNGZTU7AWqg gq9FM5pvH3SmW0dKtFK1oD7gsV8STLWw910Bv3lijGCuXl15PakZ0R5JuUqKwhbaHZqg BGFdzOw6HITCVKjxLflJhP1W8Kzo0+z8vBFm9zqD5JOpeQlvFf6FmmX3IZ5HFSnId1QH rjxdfi939jeAkIGYyXtbI5xBbqqLfK20lrlPuE7h4vu9rbd0RIz520AAESxWekwxhszd 3/NyR+1pGscPxN7sCZXZAPZoe44FDLt3+X1NEyQPqZ0BifgAMqr9gciNWv3BIsLJMB3S zdWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=qbMEKD0ZRDjermAojdisLGrE1yh1ZWB4SSiug9scVXs=; b=07d8jSbqmy01K4noU7bpS0GRXjPxYqr0eMCteWbYv7tA4QBc6+n6qpwvr11EC+spbL dXaccgHBfRQiUxg3oPz3flkK28/k6RWGkyLf52UOQwDhMkUG82sm+Nxs07Pb/aqwoDH2 ji9v1/UgZVwuQ1uO3J/gH6XWYVKDAaQKIgRH9keu8vWOm4pOTMrcWPsEuqVnvYLUV5sN t0Rkd7rHaRJxkiYrcRrbPcgXRnMeB1CyPXKHXpzG4Uw7u7rAsDwn0s8ZX4RL5p2msJa3 ZuQ/MDcpy9UxSUFhRuTc7egcyysyqoIMI0gs5gUH0EPNL8TTzi8RBG6OMz9exj7PuYdg FZnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si3601524oif.92.2020.03.08.19.22.24; Sun, 08 Mar 2020 19:22:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbgCICP2 (ORCPT + 99 others); Sun, 8 Mar 2020 22:15:28 -0400 Received: from mga18.intel.com ([134.134.136.126]:40323 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726449AbgCICP2 (ORCPT ); Sun, 8 Mar 2020 22:15:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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