From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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=-8.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 B5A8BC38A30 for ; Tue, 21 Apr 2020 00:48:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 73C672072D for ; Tue, 21 Apr 2020 00:48:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hAguJWaG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73C672072D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 120228E0006; Mon, 20 Apr 2020 20:48:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D1428E0003; Mon, 20 Apr 2020 20:48:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F27C58E0006; Mon, 20 Apr 2020 20:48:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id D73738E0003 for ; Mon, 20 Apr 2020 20:48:33 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 969C0824556B for ; Tue, 21 Apr 2020 00:48:33 +0000 (UTC) X-FDA: 76730026506.06.hair95_107e1a5821d1f X-HE-Tag: hair95_107e1a5821d1f X-Filterd-Recvd-Size: 3874 Received: from mail-yb1-f194.google.com (mail-yb1-f194.google.com [209.85.219.194]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Apr 2020 00:48:33 +0000 (UTC) Received: by mail-yb1-f194.google.com with SMTP id a9so6455879ybc.8 for ; Mon, 20 Apr 2020 17:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=z0ja3Th+CdUlodwbGEEsUxidU7Y+85Og8bujWPpY0cQ=; b=hAguJWaGdH55B3MavbpnIxsn7IrA16X3qfchaGAjjqNJ4KnZWCZ27FGGN3iTfnDVIj pmGgmvQ7XrVuzhl1aBsHlHmxqFGcxN+HsGUM/UjXZbT9+9OPsQZ8p+hurP+O4rQGxyen t9fA9k4/I21eO9oChjuIadcpugvzOlKrYywnUHiKSZT4xZNydTNi8ZkodiH3CS22GAco Z0EYSG8y9cVzdvHICqmf+ZiETQnHLfa8FwKmaYMNzuHzlaIYp05Lpbx15KL2rh0XO4Ks EayTLzmipUEbTvVM5CU6OPg7sxq9R0S073vUSwCdjwcgRfyv7fM1uoDGyr3PAPZu5jlj cBzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=z0ja3Th+CdUlodwbGEEsUxidU7Y+85Og8bujWPpY0cQ=; b=uFAIRbk4SG0jQoj3G/5oyL2Vo2CR8cmw83L1nHbqukVWbxglBr5l6cRxIDy6UoKO8s h4bGOeqfg29jVGvuNQqbMqFi3Xymqh+reFCsTM4qQfRGf5qDX3cdYNyrjnzrWdBCmfRQ AIwJzvoFWoUr7ITYcRaq7ke9Kwrnlv6jRLCmmuu2MI5llqw7sT355WZ7Gl5eOmGVDVR+ CfjLaER8UqxhxqmvC6cXGTsgHAw97kuJUDteNw9SM5Kccz+EC3BhqF1pbdadenGu4bNn ctBeGCCrPq+fjSDwrJJaS3NytEz9uOvbntHvzkUzVZ6NzYg5UyHjA2hpT+sOkWZrHZ0I XDtw== X-Gm-Message-State: AGi0PuaGHMI0+klFyLOe14bfBpydhgG2edBlu5YhlyaPxCpVpdZRgW2H SMQWE9lLvfmZyqnjK1VhIHBYfCq7Ioi1TsZ8eDtI7Q== X-Google-Smtp-Source: APiQypJ6DaxKI4w07yIv2d5ffhJGEtEQyzfpfwQsrY9bsV/vCWXNDin0t2nFXmc7XxRQrJuGCWHT7AZ5Gs0CJ3aynFc= X-Received: by 2002:a25:12c1:: with SMTP id 184mr13762167ybs.162.1587430112263; Mon, 20 Apr 2020 17:48:32 -0700 (PDT) MIME-Version: 1.0 References: <20200415004353.130248-1-walken@google.com> <20200415004353.130248-2-walken@google.com> <20200420194813.v7m7tmqhuza6qzoi@linux-p48b> In-Reply-To: <20200420194813.v7m7tmqhuza6qzoi@linux-p48b> From: Michel Lespinasse Date: Mon, 20 Apr 2020 17:48:20 -0700 Message-ID: Subject: Re: [PATCH v4 01/10] mmap locking API: initial implementation as rwsem wrappers To: Michel Lespinasse , Andrew Morton , linux-mm , LKML , Peter Zijlstra , Laurent Dufour , Vlastimil Babka , Matthew Wilcox , Liam Howlett , Jerome Glisse , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Daniel Jordan Content-Type: text/plain; charset="UTF-8" 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: On Mon, Apr 20, 2020 at 12:51 PM Davidlohr Bueso wrote: > With one observation below. > > >+static inline void mmap_downgrade_write_lock(struct mm_struct *mm) > >+{ > >+ downgrade_write(&mm->mmap_sem); > >+} > > Shouldn't this really be just mmap_downgrade_write()? In locking > normally don't add the _lock at the end as it implies the operation > of acquiring the lock. Hmmm, I see your point. Actually here the operation is downgrade, so arguably the name should be mmap_write_downgrade ? I'm not sure I like the name though, as it does not make it entirely obvious that the function is a locking primitive. -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.