Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2727427pxb; Mon, 31 Jan 2022 03:02:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJEK4rj7UvOD1RMYewQlWzNLU8PYUzXOJqbtG7EvciV2waaaV4l9Nb4z6DtK/UXH2B6jzh X-Received: by 2002:a17:907:3f93:: with SMTP id hr19mr16367001ejc.616.1643626972779; Mon, 31 Jan 2022 03:02:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643626972; cv=none; d=google.com; s=arc-20160816; b=wo02iOuYQu/R5jOuUkXamzSOomOfKaCeRiVJEqHyi5+qagN+ijP69qyk5Cd22q+0rZ WZ7gSfbWe7xQK02NbBEP0fv1U6sPkBYCA4U2e3Yh9zLOyHsF/CSJCvxiiJLx8X6F+LhY LD3ADqHqaQqHYI3x9ZvtJndXDSq7Gj5zLMuX+rqoDFnVq21ds6Zc/I3vXnXQ5gqebuzO ci6tHewAaeK9kTmSUsrf4XOILNkWEG/dQRkQHa565mtPLRdQB3OAgTTRcahbZ4le3rf5 wkYWoecvryv1lDqdjcoO0v61EN+/goZCks/uBgGREBxxOSE/qMJRWwowSvtf+qCc2jvp 5Etw== 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=Y2k4uPVeoJirwL08p+/VJjxEhsePEHeg9Wr+pPi/UaM=; b=KW2pJP8XSE+Ly2NQhKqU/p2vpMsFcTmjydyBeR5PtmJV4CNsJzdmZ7Pv6zr2eMuX0S WqeG23RxrzCVmbxv63+6udLqzO4PuhF6BYYLH/hfJcIsRw6PzfVQ7HM5UdRh7Ah4YUju fPj3uIUVBGB96bYYLfi1VvN8gJvBWTywvgy+ffi8HlOe+uQZqhG+LgtsilHEe46QSwsR iML1bxncZi6lPNejBHL1TO13A8V07VqpBFUaz6xbH/CZz6gX4xPBJtlHDt/bwYkW+Aj6 WpttTGYwVvHS63g0j75/vV3RA7IVzrKohovBjPr7hYEIF6XxjMZKEwF25MUWJK7YfdnA EICg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-52-ed header.b=WVJsEvoR; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-52-rsa header.b="vSQ8s0/J"; 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 sd22si7219288ejc.947.2022.01.31.03.02.20; Mon, 31 Jan 2022 03:02:52 -0800 (PST) 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-52-ed header.b=WVJsEvoR; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-52-rsa header.b="vSQ8s0/J"; 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 S1348851AbiA1NTW (ORCPT + 99 others); Fri, 28 Jan 2022 08:19:22 -0500 Received: from server.lespinasse.org ([63.205.204.226]:54401 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245035AbiA1NTI (ORCPT ); Fri, 28 Jan 2022 08:19:08 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-52-ed; t=1643375406; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=Y2k4uPVeoJirwL08p+/VJjxEhsePEHeg9Wr+pPi/UaM=; b=WVJsEvoRqkBk1wBf/PQvT+xODXvkJZ2W/KdNjDE+io9o82HbpdsxP3huXOEqePeoiipqa 4ZiZYFmKjNnl0n6DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-52-rsa; t=1643375406; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=Y2k4uPVeoJirwL08p+/VJjxEhsePEHeg9Wr+pPi/UaM=; b=vSQ8s0/J8zRmO0ii8kp4Dal6J6g7+90+5Tg8FB0H2IdHKfFKMNcbY4uu/b23/wp85T5aM pOnoLkegyz82Ymv86cgI3Mob1ZWkjQNPdDjPdfSgstcziSsUGjmhsQLiAN4Oq3KjFDqih0C akrA6ZElzAceI7GfqcA/Hx3uB4xgwNGlh4eo+ViqOgSTp0ckD0tcvXWGE2eciaPmXCP7mpw cGEv2SmbXGevETiQwcjSC3/R20Z7R6KHdPlCkgiUFqy7JfGWasujKkQIZwyeKPSD4jS+ymv FfkyfV9r8+INSo2NieNZfKcM0gOcwiJ1e5tDXPb88krQfhDssX28SUscD+QA== Received: from zeus.lespinasse.org (zeus.lespinasse.org [IPv6:fd00::150:0]) by server.lespinasse.org (Postfix) with ESMTPS id DAEF516094C; Fri, 28 Jan 2022 05:10:06 -0800 (PST) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id C5D6220328; Fri, 28 Jan 2022 05:10:06 -0800 (PST) From: Michel Lespinasse To: Linux-MM , linux-kernel@vger.kernel.org, Andrew Morton Cc: kernel-team@fb.com, Laurent Dufour , Jerome Glisse , Peter Zijlstra , Michal Hocko , Vlastimil Babka , Davidlohr Bueso , Matthew Wilcox , Liam Howlett , Rik van Riel , Paul McKenney , Song Liu , Suren Baghdasaryan , Minchan Kim , Joel Fernandes , David Rientjes , Axel Rasmussen , Andy Lutomirski , Michel Lespinasse Subject: [PATCH v2 02/35] mmap locking API: mmap_lock_is_contended returns a bool Date: Fri, 28 Jan 2022 05:09:33 -0800 Message-Id: <20220128131006.67712-3-michel@lespinasse.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220128131006.67712-1-michel@lespinasse.org> References: <20220128131006.67712-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 96e113e23d04..db9785e11274 100644 --- a/include/linux/mmap_lock.h +++ b/include/linux/mmap_lock.h @@ -162,9 +162,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