Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3197467ybf; Tue, 3 Mar 2020 01:14:50 -0800 (PST) X-Google-Smtp-Source: ADFU+vuAU6gCPNZhIntfHnoJEEkm0eplF4EZcfVrJvgVzAFSRyG+ObY5n9jiHO2jkHcAM56LdbSg X-Received: by 2002:a9d:664d:: with SMTP id q13mr2811049otm.30.1583226890750; Tue, 03 Mar 2020 01:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583226890; cv=none; d=google.com; s=arc-20160816; b=RI2ZoRpeVXWSX+UGhowP7SUbkRWi88pkA5doHJYUBcjxVbyYcr5E2x+88KsGMo1zJe gNPMsOnODuN7OTUBTdnf7ZmGozgut4JuhTNu5ZQ5CFDKcbIDgmmuk9mpZP1h2iMtlGZv Rm+dKrOlwMUh5JyBd0OLoNk+bvc30cv2Dw5r4D3V/Jyb5YPa4YRNEbPmZncP/bz6JAz8 Kgn+Hav1736wIPfFBWA8cjOwja2jo3wlpGCWLQVMs5Nowia1Mtfp6Iyugr+paNuKxiX4 o5pVTASQMv9gIx0yJ9Zj5Q0JOWGyCZWbD9nH7z5SHsxhqbVhxZ3vq4AAWrWLa+VVzHn3 duDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=UtekdY6JvdHRgYIunn1vBE/uy8R8n+NHGbmdi6LIsjU=; b=W/+nioK3H27WJ7T4za+bfme7AFkK+O/9VhPNv80O8NfoR7tgcF+wLsl5+OenOOt9DI E+rHGXS782JiEToCGg1UXdZLT+YuMF7m1iow+1LDxXkQGgl/BulHo+dyT9bSDTG7LspJ hM4nDz4kuK2a77jyOCzqE3cLtUO7f6C9rc4CDbGykY9kUwKWm0x3SDtcsgWlf0rkrC/B ym3zk+mtYh49cEKnUJayDbAfUvUgST6LRek/UTL3jqhjGpuB/56Y88a/fi/LwRkegmZG yFvbWNjD9siDDO93ymiESq5ecLvzrBKKsdnNmVWwLfBhLsInTeaooNmwhJlO2YQa+R2v xVlQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si8196770otm.47.2020.03.03.01.14.30; Tue, 03 Mar 2020 01:14:50 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728037AbgCCJN2 (ORCPT + 99 others); Tue, 3 Mar 2020 04:13:28 -0500 Received: from foss.arm.com ([217.140.110.172]:44396 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727791AbgCCJN2 (ORCPT ); Tue, 3 Mar 2020 04:13:28 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D0B62F; Tue, 3 Mar 2020 01:13:27 -0800 (PST) Received: from [10.162.16.51] (p8cg001049571a15.blr.arm.com [10.162.16.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 802903F6C4; Tue, 3 Mar 2020 01:13:23 -0800 (PST) From: Anshuman Khandual Subject: Re: [RFC 3/3] mm/vma: Introduce some more VMA flag wrappers To: Hugh Dickins Cc: linux-mm@kvack.org, "David S. Miller" , Alexey Dobriyan , Andrew Morton , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <1583131666-15531-1-git-send-email-anshuman.khandual@arm.com> <1583131666-15531-4-git-send-email-anshuman.khandual@arm.com> Message-ID: Date: Tue, 3 Mar 2020 14:43:21 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/03/2020 12:04 PM, Hugh Dickins wrote: > On Mon, 2 Mar 2020, Anshuman Khandual wrote: > >> This adds the following new VMA flag wrappers which will replace current >> open encodings across various places. This should not have any functional >> implications. >> >> vma_is_dontdump() >> vma_is_noreserve() >> vma_is_special() >> vma_is_locked() >> vma_is_mergeable() >> vma_is_softdirty() >> vma_is_thp() >> vma_is_nothp() > > Why?? Please don't. I am not at all keen on your 1/3 and 2/3 (some > of us actually like to see what the VM_ flags are where they're used, > without having to chase through scattered wrappers hiding them), > but this 3/3 particularly upset me. Can understand your reservations regarding 3/3. But I had called that out in the series cover letter that this patch can be dropped if related code churn is not justified. But 1/3 does create a default flag combination for VM_DATA_DEFAULT_FLAGS with a value that is used by multiple platforms at the moment. This is very similar to the existing VM_STACK_DEFAULT_FLAGS which has a default value. Then why cannot VM_DATA_DEFAULT_FLAGS have one ? More over this also saves some code duplication across platforms. Regarding the patch 2/3, when there are many existing VMA flag overrides like VM_STACK_FLAGS, VM_STACK_INCOMPLETE_SETUP, VM_INIT_DEF_MASK etc why cannot a commonly used VMA flag combination with a very specific meaning (i.e accessibility) get one. Do you have any particular concern here which I might be missing. > > There is a good reason for the (hideously named) is_vm_hugetlb_page(vma): > to save "#ifdef CONFIG_HUGETLB_PAGE"s all over (though I suspect the > same could have been achieved much more nicely by #define VM_HUGETLB 0); > but hiding all flags in vma_is_whatever()s is counter-productive churn. Makes sense, I can understand your reservation here. > > Improved readability? Not to my eyes. As mentioned before, I dont feel strongly about patch 3/3 and will drop.