Message ID | 20210407014502.24091-2-michel@lespinasse.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=7Ll9=JE=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 659B4C433ED for <linux-mm@archiver.kernel.org>; Wed, 7 Apr 2021 01:45:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D07DA610CE for <linux-mm@archiver.kernel.org>; Wed, 7 Apr 2021 01:45:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D07DA610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=lespinasse.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 800636B0081; Tue, 6 Apr 2021 21:45:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7352F6B0082; Tue, 6 Apr 2021 21:45:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C95B6B0085; Tue, 6 Apr 2021 21:45:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EE4466B007E for <linux-mm@kvack.org>; Tue, 6 Apr 2021 21:45:05 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A926C8249980 for <linux-mm@kvack.org>; Wed, 7 Apr 2021 01:45:05 +0000 (UTC) X-FDA: 78003877770.12.A7E6192 Received: from server.lespinasse.org (server.lespinasse.org [63.205.204.226]) by imf12.hostedemail.com (Postfix) with ESMTP id 58A9D12E for <linux-mm@kvack.org>; Wed, 7 Apr 2021 01:45:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-ed; t=1617759902; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=NVL7JPD4xKaWrJCrCCQAhxOaIfpgRthzGvlvMAcHMhY=; b=OESJ03wes2NwJiVPB7yoVDujCoaMAblbZeph6lEd4X/+SlFZQRQ4XSY8m+asM02bxuSyh JWXeIWR0c/wMGsPBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-11-rsa; t=1617759902; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=NVL7JPD4xKaWrJCrCCQAhxOaIfpgRthzGvlvMAcHMhY=; b=NNc+BYnodpTFTj+++F+FgTCacE2ASOXUqbP91WbtiNnglS6UaYxtuEGt+wSqU2Blxqvdl vlnWo0J0DnkKTLm9oabmwHdK/K8/u/6GOD3CN9KYd6gcN983vIxvIcUWdB0+umwetM+RNiq Q4y/Yah0dxXG6hwrUQpaG8j0Mdsh9eBGK3GUFwrsFLgtiyxoartjV2cLKdWQibkgRzkzF6f tbbCTYe1r/njg5mU7JFS/OZ7Z38g/uRJzwbh4mIxv/M1GNvyUS86YzzPLbjVGRzzXG+IncQ EN/IYPAxtrN4Wr4ECCqxohOG16G6xNiN8qL8r5T8FqrcOgwBH8BorhL2AFAA== Received: from zeus.lespinasse.org (zeus.lespinasse.org [IPv6:fd00::150:0]) by server.lespinasse.org (Postfix) with ESMTPS id 6B2A61601D1; Tue, 6 Apr 2021 18:45:02 -0700 (PDT) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id 5C25B19F30B; Tue, 6 Apr 2021 18:45:02 -0700 (PDT) From: Michel Lespinasse <michel@lespinasse.org> To: Linux-MM <linux-mm@kvack.org> Cc: Laurent Dufour <ldufour@linux.ibm.com>, Peter Zijlstra <peterz@infradead.org>, Michal Hocko <mhocko@suse.com>, Matthew Wilcox <willy@infradead.org>, Rik van Riel <riel@surriel.com>, Paul McKenney <paulmck@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Suren Baghdasaryan <surenb@google.com>, Joel Fernandes <joelaf@google.com>, Rom Lemarchand <romlem@google.com>, Linux-Kernel <linux-kernel@vger.kernel.org>, Michel Lespinasse <michel@lespinasse.org> Subject: [RFC PATCH 01/37] mmap locking API: mmap_lock_is_contended returns a bool Date: Tue, 6 Apr 2021 18:44:26 -0700 Message-Id: <20210407014502.24091-2-michel@lespinasse.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210407014502.24091-1-michel@lespinasse.org> References: <20210407014502.24091-1-michel@lespinasse.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 58A9D12E X-Stat-Signature: geung4wok48ema4euy8yt8wc4yozmqpd Received-SPF: none (lespinasse.org>: No applicable sender policy available) receiver=imf12; identity=mailfrom; envelope-from="<walken@lespinasse.org>"; helo=server.lespinasse.org; client-ip=63.205.204.226 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617759902-543785 Content-Transfer-Encoding: quoted-printable 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> |
Series |
[RFC,01/37] mmap locking API: mmap_lock_is_contended returns a bool
|
expand
|
diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h index 0540f0156f58..4e27f755766b 100644 --- a/include/linux/mmap_lock.h +++ b/include/linux/mmap_lock.h @@ -171,9 +171,9 @@ static inline void mmap_assert_write_locked(struct mm_struct *mm) VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm); } -static inline int mmap_lock_is_contended(struct mm_struct *mm) +static inline bool mmap_lock_is_contended(struct mm_struct *mm) { - return rwsem_is_contended(&mm->mmap_lock); + return rwsem_is_contended(&mm->mmap_lock) != 0; } #endif /* _LINUX_MMAP_LOCK_H */
Change mmap_lock_is_contended to return a bool value, rather than an int which the callers are then supposed to interpret as a bool. This is to ensure consistency with other mmap lock API functions (such as the trylock functions). Signed-off-by: Michel Lespinasse <michel@lespinasse.org> --- include/linux/mmap_lock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)