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=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 46D21C5DF60 for ; Thu, 7 Nov 2019 19:42:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F336E2075C for ; Thu, 7 Nov 2019 19:42:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PTvxLNFD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F336E2075C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A18E76B0003; Thu, 7 Nov 2019 14:42:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C94F6B0006; Thu, 7 Nov 2019 14:42:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 906766B0007; Thu, 7 Nov 2019 14:42:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 7BCEA6B0003 for ; Thu, 7 Nov 2019 14:42:34 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 22C24181AC217 for ; Thu, 7 Nov 2019 19:42:34 +0000 (UTC) X-FDA: 76130503428.11.goose31_6daedfa975c52 X-HE-Tag: goose31_6daedfa975c52 X-Filterd-Recvd-Size: 2460 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Nov 2019 19:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KVFpWOzDulBeid8afCN82toHL+r9kNvnmgoyCPgx/MY=; b=PTvxLNFDgEDJImxNYpSMN4dyq cND1bgROPYwf+yilUytbALIAKB8oi2cbh6I1oI3aawpMwWw0mQNNpXPOD40bdJyIZNW2uKSJqNnCV l5p8B6+Nf6i7CEsrOhdt3Ey+IFuAdIj1BkPA9+HAkd+pCTkE6ZBFPfQj9rOP649tH7jzP+QQ8Zt6X 3CidaLEu1vUpqB44C1NsMNcbkjSjtOEOsLgMaWOJcinvpAKg95CL3DCjeFKbEN6feru9KYFbTKQp5 ihwHqMrFZ8sUgoSa+GGz9LbgKs1q2arl+WAhAP1TjB6bMa1ESUaXh8PQPRAia7PtVS6Mnbut8a+DN g/4q1hvkQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSnfl-0000T6-To; Thu, 07 Nov 2019 19:42:25 +0000 Date: Thu, 7 Nov 2019 11:42:25 -0800 From: Matthew Wilcox To: Waiman Long Cc: Mike Kravetz , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Davidlohr Bueso , Peter Zijlstra , Ingo Molnar , Will Deacon Subject: Re: [PATCH] hugetlbfs: Take read_lock on i_mmap for PMD sharing Message-ID: <20191107194225.GE11823@bombadil.infradead.org> References: <20191107190628.22667-1-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107190628.22667-1-longman@redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) 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 Thu, Nov 07, 2019 at 02:06:28PM -0500, Waiman Long wrote: > - i_mmap_lock_write(mapping); > + /* > + * PMD sharing does not require changes to i_mmap. So a read lock > + * is enuogh. > + */ > + i_mmap_lock_read(mapping); We don't have comments before any of the other calls to i_mmap_lock_read() justifying why we don't need the write lock. I don't understand why this situation is different. Just delete the comment and make this a two-line patch.