Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4167748ybf; Tue, 3 Mar 2020 21:53:12 -0800 (PST) X-Google-Smtp-Source: ADFU+vtIB5bDfdgCwmxb/pZdFlqjXeUKJAh3YzZVuN2Vt0HBCV3QeNwA9Y6Z7SZygTQV2K84Ko2X X-Received: by 2002:a9d:4783:: with SMTP id b3mr1106043otf.212.1583301192839; Tue, 03 Mar 2020 21:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583301192; cv=none; d=google.com; s=arc-20160816; b=lOhV3z1NTppG2kGVZaQxGs3tu6ZII5Npzmp2k10TXc0gS4dnMs5cKsn5wBitJCdj3p QK8uTUYGzl2jgdB0bU1DwYGFwwgtJPtATRxt9hd/5nNE18op8LQ4Mevv+Vcfym2jIZv6 kCd8tBVlmlu/L4Jmhlb6OVBQoS52ePnqIVMsJyfrsvzDC5FUsR+aBiw21d9YPQeqkrv/ 0giT5n0YIg6KmhP74nvu7BIQ7vUSnDhbS3BXNHVzasWp3m3FZ854sZEFSEinTARWl4vL NdFIQQ3ihHfDgaJsrRF7ZRSdOykEjgpnLlj/zIB1RijNtI4UxWGskE2XMN59k78fH5U9 9ilw== 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:from:references:cc:to:subject; bh=9sBAXAYK1ob+Yb5YnmnXS8APBsRNOoGFr207iff17c0=; b=m+JLMog1m/YhbQqnXtg0/rW67ap6d9aENW9+TY5VS5DDEe0o9aYXqJQtYM+rZ+Y4eb sN87lEl+QGC3A6WRhkBqIH19YfFHvhZgmjxaXYMi8ljIOD6L53Gd1NwOZtTkp7xp+17Y pQdXEKrmi0+0xfHI2eUSV0Bltx/6i8B75yiwwZp7zsboSNvxIIQJ3aIhGbtfUyBJJTwz 3JmB65XmZCSErgc6I8QUc+ZY9ipqaIMMdXtJQApY/qTY188rhfVNK0QzDWU934PNQNvT z4rsB4Ermxqw/hbB32QsCvdeMjJkns6IAwtxKkN7zBr6n/UUxUG/jWTiyk2D8CJaS7JR Dq7g== 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 l8si586975oii.249.2020.03.03.21.53.00; Tue, 03 Mar 2020 21:53:12 -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 S1726131AbgCDFw5 (ORCPT + 99 others); Wed, 4 Mar 2020 00:52:57 -0500 Received: from foss.arm.com ([217.140.110.172]:56118 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725271AbgCDFw5 (ORCPT ); Wed, 4 Mar 2020 00:52:57 -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 E08EF30E; Tue, 3 Mar 2020 21:52:55 -0800 (PST) Received: from [10.163.1.88] (unknown [10.163.1.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DCC5B3F6CF; Tue, 3 Mar 2020 21:52:48 -0800 (PST) Subject: Re: [RFC 2/3] mm/vma: Introduce VM_ACCESS_FLAGS To: Vlastimil Babka , linux-mm@kvack.org Cc: Russell King , Catalin Marinas , Mark Salter , Nick Hu , Ley Foon Tan , Michael Ellerman , Heiko Carstens , Yoshinori Sato , Guan Xuetao , Dave Hansen , Thomas Gleixner , Rob Springer , Greg Kroah-Hartman , Andrew Morton , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org References: <1583131666-15531-1-git-send-email-anshuman.khandual@arm.com> <1583131666-15531-3-git-send-email-anshuman.khandual@arm.com> <52b4565f-2dab-c3e5-ead8-d76258f43a10@suse.cz> From: Anshuman Khandual Message-ID: Date: Wed, 4 Mar 2020 11:22:46 +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: <52b4565f-2dab-c3e5-ead8-d76258f43a10@suse.cz> 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 11:18 PM, Vlastimil Babka wrote: > On 3/2/20 7:47 AM, Anshuman Khandual wrote: >> There are many places where all basic VMA access flags (read, write, exec) >> are initialized or checked against as a group. One such example is during >> page fault. Existing vma_is_accessible() wrapper already creates the notion >> of VMA accessibility as a group access permissions. Hence lets just create >> VM_ACCESS_FLAGS (VM_READ|VM_WRITE|VM_EXEC) which will not only reduce code >> duplication but also extend the VMA accessibility concept in general. >> >> Cc: Russell King >> CC: Catalin Marinas >> CC: Mark Salter >> Cc: Nick Hu >> CC: Ley Foon Tan >> Cc: Michael Ellerman >> Cc: Heiko Carstens >> Cc: Yoshinori Sato >> Cc: Guan Xuetao >> Cc: Dave Hansen >> Cc: Thomas Gleixner >> Cc: Rob Springer >> Cc: Greg Kroah-Hartman >> Cc: Andrew Morton >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-c6x-dev@linux-c6x.org >> Cc: nios2-dev@lists.rocketboards.org >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: linux-s390@vger.kernel.org >> Cc: linux-sh@vger.kernel.org >> Cc: devel@driverdev.osuosl.org >> Cc: linux-mm@kvack.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual > > Dunno. Such mask seems ok for testing flags, but it's a bit awkward when > initializing flags, where it covers just one of many combinations that seem > used. But no strong opinions, patch looks correct. Fair enough. The fact that it covers only one of the many init combinations used at various places, is indeed a good point. The page fault handlers does start with VMA flags mask as VM_ACCESS_FLAGS, hence will keep them and drop other init cases here.