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=-11.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, 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 158A6C2BA17 for ; Mon, 6 Apr 2020 15:49:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CAE2520753 for ; Mon, 6 Apr 2020 15:49:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Lk+g/0wm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAE2520753 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 43CC98E003C; Mon, 6 Apr 2020 11:49:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 412DC8E000D; Mon, 6 Apr 2020 11:49:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 328F88E003C; Mon, 6 Apr 2020 11:49:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id 1BF318E000D for ; Mon, 6 Apr 2020 11:49:35 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C2E17181AC9CB for ; Mon, 6 Apr 2020 15:49:34 +0000 (UTC) X-FDA: 76677865068.09.cord21_19659522bb51c X-HE-Tag: cord21_19659522bb51c X-Filterd-Recvd-Size: 4657 Received: from mail-yb1-f193.google.com (mail-yb1-f193.google.com [209.85.219.193]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Apr 2020 15:49:34 +0000 (UTC) Received: by mail-yb1-f193.google.com with SMTP id c13so74902ybp.9 for ; Mon, 06 Apr 2020 08:49:34 -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 :cc; bh=W/3b78oJ09xJkiGfrBiJR5l3+5N4Ozbz5u6ig6+HSko=; b=Lk+g/0wmVGpGlrqBdfdX+z0aKzeA4LGEFY2825RDe1iQv8Cm7vlebpkdzF0wU3fKny mB5+W+fc8rVAYKW5ArHQOt6x0neNCj2oNVVD4xNudOalqTj3dKhC580gdG04oFb3gMB3 DAhzLMgpWWbquWBXtNuCyd/MTtI+DYWY3wDcEPXYJw1pjKj04mHP4k148ZvuzFly/W3f 3tDw8KUXg+jAxHeiX0GPRez01zErS0IfYusuE54oVqv8TzlPHnLnSjS6IKPfN2C4upED 51MrCT0TOHsrfTjF9+iRZapEvp7meWjZ+Tu0wvWpYB/A4ZUwqHcE5N96otIRiSC3sttN 9Mvw== 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:cc; bh=W/3b78oJ09xJkiGfrBiJR5l3+5N4Ozbz5u6ig6+HSko=; b=czBagvOSHbxhG7JCHjMit5Np2gx8UK16Q9KHyBjmHSY9qpS7PE7tU/1DanNhdlZTrQ 02Pt1ng99+XK+ftqQLfduJNvlm+fKcxbF+IGgA65zEXBt9e6EAijVkE92JdiJRNLkjNJ cN3ReChaurGLIaiKp+Bymz6I679t5he2XwJMyGI6n9RXO51RYLj3bSxzyLMLQ8KWLTuS bVKryrui+i/3n3JsalvpjqNrWtKO5BFz4CskB2rEPHS2IMPI+mOzh7ZGBsfD1toj8aY4 oh0poCHTGizspgGT/oG/gJPKXHuGd2TJqnotgP/F25Y2TJnrp4DfALkp7S3qMF51l/UJ YvAA== X-Gm-Message-State: AGi0PuZCFwn40ozhupKC3w3Ejf+d6LAHkuWbJYE016gAHGbo7bqVzvWe bAXs0CK0nK926LC4MgFsfhDnCh+I6f3GaZGgnwkkFQ== X-Google-Smtp-Source: APiQypI3Q9m2jolxt+9cNUCkVprdmIltsXpYYGqSNMxBq5Jtyad05BwTo8VY+vSoJTNUvv2Uqrkf7jE2UT0m9E+2rRE= X-Received: by 2002:a5b:cc7:: with SMTP id e7mr37091185ybr.7.1586188173435; Mon, 06 Apr 2020 08:49:33 -0700 (PDT) MIME-Version: 1.0 References: <20200327225102.25061-1-walken@google.com> <20200327225102.25061-11-walken@google.com> <20200401134853.GT20696@hirez.programming.kicks-ass.net> In-Reply-To: <20200401134853.GT20696@hirez.programming.kicks-ass.net> From: Michel Lespinasse Date: Mon, 6 Apr 2020 08:49:21 -0700 Message-ID: Subject: Re: [PATCH v3 10/10] mmap locking API: rename mmap_sem to mmap_lock To: Peter Zijlstra Cc: Andrew Morton , linux-mm , LKML , Laurent Dufour , Vlastimil Babka , Matthew Wilcox , Liam Howlett , Jerome Glisse , Davidlohr Bueso , David Rientjes , Hugh Dickins , Ying Han , Jason Gunthorpe , Markus Elfring 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 Wed, Apr 1, 2020 at 6:48 AM Peter Zijlstra wrote: > > On Fri, Mar 27, 2020 at 03:51:02PM -0700, Michel Lespinasse wrote: > > Rename the mmap_sem field to mmap_lock. Any new uses of this lock > > should now go through the new mmap locking api. The mmap_lock is > > still implemented as a rwsem, though this could change in the future. > > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > > index c28911c3afa8..a168d13b5c44 100644 > > --- a/include/linux/mm_types.h > > +++ b/include/linux/mm_types.h > > @@ -431,7 +431,7 @@ struct mm_struct { > > spinlock_t page_table_lock; /* Protects page tables and some > > * counters > > */ > > - struct rw_semaphore mmap_sem; > > + struct rw_semaphore mmap_lock; > > It would be best if you change the type too. I suppose you mean wrapping the struct rw_semaphore within a new struct ? I did not do that in this patchset because there remains some calls to lockdep_assert_held() on that field, which imply that the field must have a .dep_map field that's not tucked away behind an additional struct. I have another patchset that reimplements the mmap_lock as a different type (for range locking), with its own dep_map handling, but it's not ready for pushing to mainline yet... -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.