Message ID | 20181101095844.24462-6-mathieu.desnoyers@efficios.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C7FC13B5 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 1 Nov 2018 09:59:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E61372B663 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 1 Nov 2018 09:59:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D84462B68E; Thu, 1 Nov 2018 09:59:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF6912B663 for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 1 Nov 2018 09:59:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C2FB96B0269; Thu, 1 Nov 2018 05:59:34 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BE00B6B026A; Thu, 1 Nov 2018 05:59:34 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACDB36B026B; Thu, 1 Nov 2018 05:59:34 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 831266B0269 for <linux-mm@kvack.org>; Thu, 1 Nov 2018 05:59:34 -0400 (EDT) Received: by mail-qk1-f198.google.com with SMTP id v184-v6so20333644qkh.23 for <linux-mm@kvack.org>; Thu, 01 Nov 2018 02:59:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-filter:dkim-signature:from:to:cc:subject :date:message-id:in-reply-to:references; bh=N3v2LzU7/zfxpIewN1Lf4Ei0VdWx18Nl2AhIPWVI0IE=; b=HQiW5MjcvqRGkMYnPx9o33Go4qF4+2APaf1UPSFxBiHYJgYnH5nWofDINMsm5oge8B 4pK/nF7yQuaDVxGVubD1XYR6p9PjAfhZ7I4/H3L7YJ3p4A+L+5PZy0M6owOvBxgf7MxL OW/fXlStFAZbbf3GJDfgjlI7KFex1iQEeo1MTEZKIwrmNkUS4LG506DVWAOlAcD2aJYM bLvfeMhrpC6TXXjgmWEZoSZW8uLqYgf1DWXjJbXW4a5/KkIIbYyMrXBCPU11a+vBCOEC SPIPn9CP6NPlm/RNqVSMgnY+s/bkGlGH4DD0noXvVa3ttJNlra5dhaEP7/kCnz2H2NbM +67Q== X-Gm-Message-State: AGRZ1gK2Wd20DxWU993+oHuyrJ4n3c9W9ZyEJMflb1T9pZ3fw6cirBx7 7cRoQ4KgxkByF3OEUYUJvnArbOmLkWkNAl+sJd92P07DmFiZSefdrIPfJED6lbJPtSY2xgoaUd7 4h4okVouuuLnoqX9jZ/8f0KdvCjQD+cqcDeDrcL5KGUyEzcYy3qKcH8WZBOf4EZBDMA== X-Received: by 2002:a37:6c01:: with SMTP id h1-v6mr5891504qkc.67.1541066374232; Thu, 01 Nov 2018 02:59:34 -0700 (PDT) X-Google-Smtp-Source: AJdET5du+CdamIJtvrHD0g2tDQa8XzFp7vzpic40SKW3KJdCz5wOacBBJFOXIWCc/7xYDULMrvlH X-Received: by 2002:a37:6c01:: with SMTP id h1-v6mr5891476qkc.67.1541066373646; Thu, 01 Nov 2018 02:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541066373; cv=none; d=google.com; s=arc-20160816; b=JfZnfrK3zYFO2leRG1tlWvzRE3NM36XloPtJgtTxH16xpxfkj8Um8Jt+RmlBHrRs6C LZRcV/T29O95BEgLsQUTFWBm6GiU/Xj+MTT8OK21xHOZN8Ubw/Yizfbn4+LavOtt0GlI zBkqblKvNmQnJx7AGEMcdvz2R0wUTWbonFTroGnie971cXC9SxaU5/DogbqJrN3EDnue tnCT+hV3zYY+bxQoiV/dea32xjyWiRghSyiJ+rW2YDyEPWqfGWwgJB8LTIoJjPE/i9Az ZTclU3j/iLjyPtmwtxSlrlVvuH9YAhamiKOT0fjxi+5vXm+/Dfutn0p99KTkNENdKuhQ x9ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=N3v2LzU7/zfxpIewN1Lf4Ei0VdWx18Nl2AhIPWVI0IE=; b=qA6lEEqyuBXrnxW6li7IfuMvtHU/2mtGb+FPrChQVNSZ6tN4fl5ALTNyddUS6HuhGg FNSVm9CzcdCs5E2DrnwLE8sRgwUe+tYQvsjIahR2xR9kv6o9JXLOtdWenczGZ9PRzkNv kyV5BWtNKqpuQfOZlrJXhKQu4cuuxl3MT2nmWPCw5n/6UkhgJd/xEz2FY5OGkognG+Xx vcT3bdlviKqptOg3fd1+fVcgzrX9RrAYbjcrcH1/oAJlkX/qn0UUocw5qGeDSQB670rM UInUNoCzzoTlGMr9NiWrpPHXDuXCd//hF14YySYcs3glDV8y7UOi5uept7Lcxj9eHJ6P Fkbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=TbhuP1e0; spf=pass (google.com: domain of mathieu.desnoyers@efficios.com designates 2607:5300:60:7898::beef as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from mail.efficios.com (mail.efficios.com. [2607:5300:60:7898::beef]) by mx.google.com with ESMTPS id k18-v6si311183qtj.22.2018.11.01.02.59.33 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 02:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of mathieu.desnoyers@efficios.com designates 2607:5300:60:7898::beef as permitted sender) client-ip=2607:5300:60:7898::beef; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=TbhuP1e0; spf=pass (google.com: domain of mathieu.desnoyers@efficios.com designates 2607:5300:60:7898::beef as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 53EC6227675; Thu, 1 Nov 2018 05:59:32 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id X6zKOFr8iNaF; Thu, 1 Nov 2018 05:59:31 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id BBC3A22766F; Thu, 1 Nov 2018 05:59:31 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com BBC3A22766F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1541066371; bh=N3v2LzU7/zfxpIewN1Lf4Ei0VdWx18Nl2AhIPWVI0IE=; h=From:To:Date:Message-Id; b=TbhuP1e0bdHIwDB0cwHVKv+Z+psJKG9+mIKl7f157uPcoc7c7NurDCULzSizcRQQQ VDewX/KkZihjislKs/3eIcE98ePjZlsghsFBjUQziVMaQ7/KmQkfEwSQSpTJZQmPfE gVCwWZym9W0sFLcxRvkcvkhQVb9Nx5OEgpog9jnE7RoFDQnwrKktqS1e7aKK3t9VfG icm75LePQvAZlL/xNspY08nop3jLusGzT+CWJqUK7dFxsNItdfq5J9YcH4OEmDjPJr 0WAcCvAYZn58El4hgfq4F/P3JB3IUOsC37ah/nOHTJLTLw2M6JGpWy2hNLOcwNz1Em 8wt27ni6gZH6Q== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id N5HyUErGjTqi; Thu, 1 Nov 2018 05:59:31 -0400 (EDT) Received: from thinkos.etherlink (sessfw99-sesbfw99-92.ericsson.net [192.176.1.92]) by mail.efficios.com (Postfix) with ESMTPSA id CF580227653; Thu, 1 Nov 2018 05:59:25 -0400 (EDT) From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> To: Peter Zijlstra <peterz@infradead.org>, "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>, Boqun Feng <boqun.feng@gmail.com> Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>, Andy Lutomirski <luto@amacapital.net>, Dave Watson <davejwatson@fb.com>, Paul Turner <pjt@google.com>, Andrew Morton <akpm@linux-foundation.org>, Russell King <linux@arm.linux.org.uk>, Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>, Andi Kleen <andi@firstfloor.org>, Chris Lameter <cl@linux.com>, Ben Maurer <bmaurer@fb.com>, Steven Rostedt <rostedt@goodmis.org>, Josh Triplett <josh@joshtriplett.org>, Linus Torvalds <torvalds@linux-foundation.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Michael Kerrisk <mtk.manpages@gmail.com>, Joel Fernandes <joelaf@google.com>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, linux-mm@kvack.org Subject: [RFC PATCH for 4.21 05/16] mm: Provide is_vma_noncached Date: Thu, 1 Nov 2018 10:58:33 +0100 Message-Id: <20181101095844.24462-6-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181101095844.24462-1-mathieu.desnoyers@efficios.com> References: <20181101095844.24462-1-mathieu.desnoyers@efficios.com> 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: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
None
|
expand
|
diff --git a/include/linux/mm.h b/include/linux/mm.h index 0416a7204be3..18acf4f339f8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2551,6 +2551,30 @@ static inline struct page *follow_page(struct vm_area_struct *vma, return follow_page_mask(vma, address, foll_flags, &unused_page_mask); } +static inline bool pgprot_same(pgprot_t a, pgprot_t b) +{ + return pgprot_val(a) == pgprot_val(b); +} + +#ifdef pgprot_noncached +static inline bool is_vma_noncached(struct vm_area_struct *vma) +{ + pgprot_t pgprot = vma->vm_page_prot; + + /* Check whether architecture implements noncached pages. */ + if (pgprot_same(pgprot_noncached(PAGE_KERNEL), PAGE_KERNEL)) + return false; + if (!pgprot_same(pgprot, pgprot_noncached(pgprot))) + return false; + return true; +} +#else +static inline bool is_vma_noncached(struct vm_area_struct *vma) +{ + return false; +} +#endif + #define FOLL_WRITE 0x01 /* check pte is writable */ #define FOLL_TOUCH 0x02 /* mark page accessed */ #define FOLL_GET 0x04 /* do get_page on page */
Provide is_vma_noncached() static inline to allow generic code to check whether the given vma consists of noncached memory. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> CC: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> CC: Peter Zijlstra <peterz@infradead.org> CC: Paul Turner <pjt@google.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Andy Lutomirski <luto@amacapital.net> CC: Andi Kleen <andi@firstfloor.org> CC: Dave Watson <davejwatson@fb.com> CC: Chris Lameter <cl@linux.com> CC: Ingo Molnar <mingo@redhat.com> CC: "H. Peter Anvin" <hpa@zytor.com> CC: Ben Maurer <bmaurer@fb.com> CC: Steven Rostedt <rostedt@goodmis.org> CC: Josh Triplett <josh@joshtriplett.org> CC: Linus Torvalds <torvalds@linux-foundation.org> CC: Andrew Morton <akpm@linux-foundation.org> CC: Russell King <linux@arm.linux.org.uk> CC: Catalin Marinas <catalin.marinas@arm.com> CC: Will Deacon <will.deacon@arm.com> CC: Michael Kerrisk <mtk.manpages@gmail.com> CC: Boqun Feng <boqun.feng@gmail.com> CC: linux-mm@kvack.org --- include/linux/mm.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)