Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp578287pxf; Wed, 7 Apr 2021 06:53:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3sxHemgnGF+JNiUIKyRrsuaGPcEsd1gZnzFmKKKwIaPLuykp5XEkmTVO657FPnenLPOJ8 X-Received: by 2002:aa7:c893:: with SMTP id p19mr4557288eds.137.1617803614935; Wed, 07 Apr 2021 06:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617803614; cv=none; d=google.com; s=arc-20160816; b=eapE2wNM3sgZhOpuH6q/kUPdwKGjKhBdcMaaAWi+LhXAZD+GWYS9CGyDGdvrpGYqR+ GG6QdXmpz+Ll5E49CBFtNJLsFN+jNyoKutQFoXyX6UYaEypUWRk6XnbWCXkIFa/jzmOX 0LVmJEc98aw/2Wpkjfbpqt++afG3IHXc8uYuYBYdhiFR4bUn2e1OkWC3s9qtUv8lF2IR ve2LCYGszB8IXKFowlpaOhq7HAmaPE11EepSNtpFOi1nrhapv7BmbPH9YDXcPW7hFEur riDO2HhGPzAdpPkQIROPTfh4OyyVXivchZKcNhTGVNIt6wf6cr+i/iyzvjO1ez0Qhp1e lUIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=NVL7JPD4xKaWrJCrCCQAhxOaIfpgRthzGvlvMAcHMhY=; b=IJiq9SdozJ92E9iuit2P2TNsoK5vssQ4lMcawGEA08jCPimgicEh3wa1Dyq4CFnXIj bX5omrQSMBSIm347xtQ8ckZaMco7rOVAqu8F4F5+LwcfC5oBpK+sUpPYIDiUkR2KH1qq VJYT40uNDWRgEPIpwsnRRZYo/MdZH7YmJj/97I++VIGDqQ73xZxtBtCsDgVXFJudhJCE tL0OLS/bnCwl73zB/Y0BOT/hYCZci8XEgUdwdBPFD/ThxjFGSDl8PnooFAnwMzbY8z8u EwrInjLjJYZZuf5EEEqLnOwlxvvPwo5CEUKOQWYIQuw8gn2evtdLCQZ/eaU+WC2F30uY h2lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-11-ed header.b=OESJ03we; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-11-rsa header.b=NNc+BYno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci5si7369276ejc.731.2021.04.07.06.53.11; Wed, 07 Apr 2021 06:53:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-11-ed header.b=OESJ03we; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-11-rsa header.b=NNc+BYno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243176AbhDGBxQ (ORCPT + 99 others); Tue, 6 Apr 2021 21:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347839AbhDGBvx (ORCPT ); Tue, 6 Apr 2021 21:51:53 -0400 Received: from server.lespinasse.org (unknown [IPv6:2602:303:fcdc:ce10::100:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C87C06175F for ; Tue, 6 Apr 2021 18:51:41 -0700 (PDT) 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 To: Linux-MM Cc: Laurent Dufour , Peter Zijlstra , Michal Hocko , Matthew Wilcox , Rik van Riel , Paul McKenney , Andrew Morton , Suren Baghdasaryan , Joel Fernandes , Rom Lemarchand , Linux-Kernel , Michel Lespinasse 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/linux/mmap_lock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 */ -- 2.20.1