Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp635085pxy; Fri, 30 Apr 2021 12:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsoR9oca1LScTsZMn3nyle1718NVsWZNce/Ej/FuQjQiSUPyigE/QnDiJlcuvEmPtlnSC1 X-Received: by 2002:a17:903:22cd:b029:ee:9b67:4012 with SMTP id y13-20020a17090322cdb02900ee9b674012mr5732553plg.15.1619812416285; Fri, 30 Apr 2021 12:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619812416; cv=none; d=google.com; s=arc-20160816; b=m9dOvcwTEzdAdaZESv8n26r8OfLNTub+BjqmjCKr1+QgI7Ome8lJ7rpIiorNvFszTL FVZ9EOpuO/eMcO+Mg1mXNsy+//WTQVsKMkO7paWuHnyF/KCfZii3UoUU1IjhoT9+oOv0 jfkFhDeKH+hfExHdzfgRqMioEhmydLuzfUqsUvzg4SkXzSdfhxqrFvPGfzUbL6LGR0CR gap4LA6FNBOKhuHUAPwovt97xJxDNnhb9g32+X7EO6rLdLe26KZGmbFcrw2KtZPgfoXI e57S2+m4aNQScWWegAyuOEkOvOLHo+7scvjXiOkAIoWaAJJdnHimFmXiCXq4GaHQOTFz mrlw== 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=hiNJTHJXgPP5dshkJ6KZ8TiP/0uZdtFYnCoCaPwelvZ107pkoM/ju/1c/O+agWHSQg duEPxGqHs+uILyGYzkFm/x/W+E0WB2TIyqbd9crCWqgyJc3D0l3XhxKSubcHKD3SJgUF U0b+8ENTz555xcnwzOPPnw3CBkTbE4WaWM+WxNi5137wnvmEqPjMY8noTvD4ffkEK1W7 zYPXXXChjSa80a5EIhq04N1+fWtMZiFYtQl/FGPewoH1ZzPaIKbKqjcUYIXxDfEfESRf bwLX8M6+bvn6fqC9LM8a+kGR1b3XplBDjraeP80ENugQnG9OU0GpNtqHtNEF7ABW3nQ2 4Pbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-14-ed header.b=seFAG+sw; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-14-rsa header.b=Hr12W9SJ; 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 ay12si4467026plb.357.2021.04.30.12.53.24; Fri, 30 Apr 2021 12:53:36 -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-14-ed header.b=seFAG+sw; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-14-rsa header.b=Hr12W9SJ; 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 S233320AbhD3Txh (ORCPT + 99 others); Fri, 30 Apr 2021 15:53:37 -0400 Received: from server.lespinasse.org ([63.205.204.226]:48971 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231250AbhD3TxW (ORCPT ); Fri, 30 Apr 2021 15:53:22 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-14-ed; t=1619812353; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=NVL7JPD4xKaWrJCrCCQAhxOaIfpgRthzGvlvMAcHMhY=; b=seFAG+swPapZKqpejXszQzpaIdmpkFiiKJBqE4tgh7BHr7TiZ7gnyCpxzN8EIlmwm8g58 W9e7ERKDPuPRXxvCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-14-rsa; t=1619812353; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=NVL7JPD4xKaWrJCrCCQAhxOaIfpgRthzGvlvMAcHMhY=; b=Hr12W9SJ/k10T+AhevxFw7Xi/5TWRi39IsNggQfIKgJvy8FTTJ/1TIWDD4/EM8/GYwZpv wOk+SqRuC5x5GH5yfrje+m/9tY/aG8W7ipIjF2hwVdNO3FcbbB82d+GTS7m9JoiNr0ywZrn mElAhRQk77OBX5vcMLgCS9rQAva0NBgBVAFWJzGc81wJJOeImQFD3aKpNbJ+r+0VMABNEyL 50XdZ6f4s2Y8lv/vqQRJllplvm4dz8f0IcOlja45ytEz53pLQ755IUI7QSltT6/N+Zwz8TK /sCXe+fw3IZD5K1NRhozh6yhxnVV821EBybHtmFvC/e3DjInR9QutLwILhGQ== Received: from zeus.lespinasse.org (zeus.lespinasse.org [10.0.0.150]) by server.lespinasse.org (Postfix) with ESMTPS id 1698016030A; Fri, 30 Apr 2021 12:52:33 -0700 (PDT) Received: by zeus.lespinasse.org (Postfix, from userid 1000) id 0638519F523; Fri, 30 Apr 2021 12:52:33 -0700 (PDT) From: Michel Lespinasse To: Linux-MM , Linux-Kernel Cc: Laurent Dufour , Peter Zijlstra , Michal Hocko , Matthew Wilcox , Rik van Riel , Paul McKenney , Andrew Morton , Suren Baghdasaryan , Joel Fernandes , Andy Lutomirski , Michel Lespinasse Subject: [PATCH 02/29] mmap locking API: mmap_lock_is_contended returns a bool Date: Fri, 30 Apr 2021 12:52:03 -0700 Message-Id: <20210430195232.30491-3-michel@lespinasse.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210430195232.30491-1-michel@lespinasse.org> References: <20210430195232.30491-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