Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3078650ybf; Mon, 2 Mar 2020 22:34:22 -0800 (PST) X-Google-Smtp-Source: ADFU+vtowQBnq0/HzsO/5t8Ez1Bmby40cpd+dUuUJEu1qJZpqTsdqMquGbZRLh8WTy6G/vDKDTWg X-Received: by 2002:aca:fdc6:: with SMTP id b189mr1441058oii.10.1583217262447; Mon, 02 Mar 2020 22:34:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583217262; cv=none; d=google.com; s=arc-20160816; b=to+OcCyfe2ub+1oARB42TOIUIns+SHi1bamdMgfksqAtvccRHl/Iy+i5IB+SpvJrIC RzP3zno7pANveSlcYjK09KM1cQ1M7NQO5LUz2vhMmP0/spMgW3yYJjbzv2ABXEcf1vht 4GoaFy5kaS1p1yR0LRe6zNEVaTLL5lqd2Opd5Sq2AdOh5Ti36R9mzhvktCLfeh9bd3tK mlrMy7aD+Szv+hCt9NvO6FSCD9VxOzKN17Ey2IYJUWNHuJ2AHxfgBz9/vkYHhf396H2X gEsxh/a4FQ6HcLUcsRelfLR1veHOl/x/XchaNVd+CYdf9v/bS88aZPvVwB/dGZ4LJuiF vc6w== 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:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=nd/TEeW4LQOvJMaEt1rZVabT2kTJB3dRDcejupbt5xY=; b=eY3AzZT09czK9VgVLopP5LkgcqK7jLM0x4Fu4nBiAtjH1uG8dBUK7vMSgEQMoJqXg5 hzqUHpz/OP/4oUOJI+iz/BU4NO5Or9+zKdU72jNEoqjtwW5BijD3LJ1MRRPPKHw/gNvR 4s7CGLEW+uTVtPHfy5xgNMPHSb0J8WTwB4ehl/FPd/XURKi7HzwNDXCjmcf/wPiWERZR aHZtZH2Jo8ZzNyvJsrKWgaa4o6mHDqVGm/Hl4KazIkVUkZyxeo97I5Nhkq4LFOcrpcJT AQYYdCniG3UnFqYiHcUUOtanqwORbbiZq2A8ciXhivDCFGO5nwYrIEZAK4SQ6JwqKUK7 PWFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RT+Kea4i; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u207si484960oia.176.2020.03.02.22.34.09; Mon, 02 Mar 2020 22:34:22 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=RT+Kea4i; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725879AbgCCGeE (ORCPT + 99 others); Tue, 3 Mar 2020 01:34:04 -0500 Received: from mail-ot1-f44.google.com ([209.85.210.44]:42662 "EHLO mail-ot1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgCCGeE (ORCPT ); Tue, 3 Mar 2020 01:34:04 -0500 Received: by mail-ot1-f44.google.com with SMTP id 66so1905720otd.9 for ; Mon, 02 Mar 2020 22:34:04 -0800 (PST) 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=nd/TEeW4LQOvJMaEt1rZVabT2kTJB3dRDcejupbt5xY=; b=RT+Kea4iOHlH9H/H9pNH1Sk5JZ4dns1gAbgYhpwbXqqZbzVX5jEh1et1qoLilG5wVs oO2JK/0A0BWeTpwrk38qIZ6XZ4P3iBdLicT+oqLeMT/lp5vTN+FuRTu9OOkmhkC8cJca VNnFYWcAPZnYcrYLsnEGl2OTcQKWgZgulNDfrJbAPifq7V9ST4c9TsnqL5L3xl31itA7 zTqGIMx5oodNwYKcTa39nYsVUZd9viLRjg7pyd6NoVpKZ1KakGNLr2ZMf2jo0YkKKo7G qZSY6uQZE16aoTg0ZtnBdaWfz1YWULza/Pk+PtsfaW25hJEnjirgGc/h7Hl4hMWxRARM 8K9Q== 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=nd/TEeW4LQOvJMaEt1rZVabT2kTJB3dRDcejupbt5xY=; b=IqBv5BjWdGmOCnHTJNteBlgrHKpy4kv9Uu4bqWokC2OPmpRb0VQe1b0Wd2oRmwrKBU phXPLfsKavhsjcizWoV79sd/IBAh9aOHqme6KpxFGnsY7h9tBd1OXtBDdzHhDRe7RS8F zJ6qC1KroEcudBL/jfJBO5igDv0ksUT5FSkq6NhVsviikSpYZvizLt2mbCdkc3PdsOhB Y6aNyCbreodsLae+3ZFcYyJB+ZdkMl/LxgnqknlKAEjAeHbTRTKiawsbv4LjZ037kXfs GpQEMcHigwGGc6a4P8aodWxpxjkW/4FDVIvBrWJZ2hK2KIGImXnZyrEUqvJTYwzkluNX 3MdA== X-Gm-Message-State: ANhLgQ1LuP0Huv0nbT8mfvJoshPr63WuByloxSVzqvlPFEp80/HR1y+V zm6VPzf44YWbR+9nZjXUB489Xw== X-Received: by 2002:a05:6830:1203:: with SMTP id r3mr2352162otp.230.1583217243235; Mon, 02 Mar 2020 22:34:03 -0800 (PST) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id z10sm7243729oih.1.2020.03.02.22.34.01 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Mar 2020 22:34:02 -0800 (PST) Date: Mon, 2 Mar 2020 22:34:00 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Anshuman Khandual 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 , Hugh Dickins , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC 3/3] mm/vma: Introduce some more VMA flag wrappers In-Reply-To: <1583131666-15531-4-git-send-email-anshuman.khandual@arm.com> Message-ID: References: <1583131666-15531-1-git-send-email-anshuman.khandual@arm.com> <1583131666-15531-4-git-send-email-anshuman.khandual@arm.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Improved readability? Not to my eyes. Hugh