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=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 408A7C48BDF for ; Thu, 10 Jun 2021 10:40:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2493A613D0 for ; Thu, 10 Jun 2021 10:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbhFJKmr (ORCPT ); Thu, 10 Jun 2021 06:42:47 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:55992 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbhFJKmq (ORCPT ); Thu, 10 Jun 2021 06:42:46 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BB0721FD47; Thu, 10 Jun 2021 10:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623321648; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e69p7cSpTPxrgycR/WxxaL+1l2Iy0njG9LV0PDer+c4=; b=WNzicnn9I9Uzi3rhrzU3g34rvVnvDxp/dzgOfJ8QelNeJaO+n3iduUNFK/9KFkm8z8EeQW NL1SjEN/b720E7re5xPsC8EubYb6b5KZXIu9/vLgcdL89PUhpyLXDk4QFY4xIwUI5aT9rc RHr+TtYt2pnBErVijdh7TG9nIRAFQQs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623321648; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e69p7cSpTPxrgycR/WxxaL+1l2Iy0njG9LV0PDer+c4=; b=ldzR16nIFLY7YSLUeT9j/700yV/caPCby06yFrv/SQbZy/V+JI6iP9FH6mfkFJSIwBuRfv KhEDZH21lxejVFDA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id 24988A3B8B; Thu, 10 Jun 2021 10:40:48 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id E025A1F2CAB; Thu, 10 Jun 2021 12:40:47 +0200 (CEST) Date: Thu, 10 Jun 2021 12:40:47 +0200 From: Jan Kara To: Ming Lei Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Dave Chinner , ceph-devel@vger.kernel.org, Chao Yu , Damien Le Moal , "Darrick J. Wong" , Jaegeuk Kim , Jeff Layton , Johannes Thumshirn , linux-cifs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, linux-xfs@vger.kernel.org, Miklos Szeredi , Steve French , Ted Tso , Matthew Wilcox , Christoph Hellwig , Hugh Dickins Subject: Re: [PATCH 01/14] mm: Fix comments mentioning i_mutex Message-ID: <20210610104047.GA23539@quack2.suse.cz> References: <20210607144631.8717-1-jack@suse.cz> <20210607145236.31852-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org On Thu 10-06-21 17:06:41, Ming Lei wrote: > On Mon, Jun 07, 2021 at 04:52:11PM +0200, Jan Kara wrote: > > inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix > > comments still mentioning i_mutex. > > > > Reviewed-by: Christoph Hellwig > > Acked-by: Hugh Dickins > > Signed-off-by: Jan Kara > > --- > > ... > > > diff --git a/mm/rmap.c b/mm/rmap.c > > index 693a610e181d..a35cbbbded0d 100644 > > --- a/mm/rmap.c > > +++ b/mm/rmap.c > > @@ -20,9 +20,9 @@ > > /* > > * Lock ordering in mm: > > * > > - * inode->i_mutex (while writing or truncating, not reading or faulting) > > + * inode->i_rwsem (while writing or truncating, not reading or faulting) > > * mm->mmap_lock > > - * page->flags PG_locked (lock_page) * (see huegtlbfs below) > > + * page->flags PG_locked (lock_page) * (see hugetlbfs below) > > * hugetlbfs_i_mmap_rwsem_key (in huge_pmd_share) > > * mapping->i_mmap_rwsem > > * hugetlb_fault_mutex (hugetlbfs specific page fault mutex) > > @@ -41,7 +41,7 @@ > > * in arch-dependent flush_dcache_mmap_lock, > > * within bdi.wb->list_lock in __sync_single_inode) > > * > > - * anon_vma->rwsem,mapping->i_mutex (memory_failure, collect_procs_anon) > > + * anon_vma->rwsem,mapping->i_mmap_rwsem (memory_failure, collect_procs_anon) > > This one looks a typo. Actually it isn't a typo. Memory failure path doesn't touch inode->i_rwsem at all. It uses mapping->i_mmap_rwsem in collect_procs_file(). So perhaps the functions listed there should be updated to (collect_procs_anon(), collect_procs_file()) but the lock name change is IMO correct. Honza -- Jan Kara SUSE Labs, CR 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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 3CA75C47094 for ; Thu, 10 Jun 2021 10:41:27 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E3AED613C6; Thu, 10 Jun 2021 10:41:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3AED613C6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lrI7m-0001VK-8F; Thu, 10 Jun 2021 10:41:22 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrI7O-0001UP-V8 for linux-f2fs-devel@lists.sourceforge.net; Thu, 10 Jun 2021 10:40:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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=e69p7cSpTPxrgycR/WxxaL+1l2Iy0njG9LV0PDer+c4=; b=ggExYkneUOpZ8NnCCsCUCMpAaP kCE7Cu9QDUGifGsJ6fxJjHw+hbyAwOlU6jgdx8juY5px7KVrwUk8FA6m/Pppp3+41f1LBWWYB3TWz RnzMmUEyYiXmKsVLndlLpEayz8iVyEZRJsYRmdk/9ZXAV36M3mLV6mF5QFUoCitgM+PM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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=e69p7cSpTPxrgycR/WxxaL+1l2Iy0njG9LV0PDer+c4=; b=VMS5wAgqhO6n9HzppDhlWRZHey 5+VA8N/k5KiD90m7MjgN0jSfyIulP1sda5Qhswf5xvjcS/AVuRvuYkbLqg9O6JEt15USKZv/XOnDe UkaHndNj2L/k1qw+Pm8OCfzvVsIBHtPAiq/49/23/RY7Mql/GZGw+u9zcrADQgKXCtYI=; Received: from smtp-out2.suse.de ([195.135.220.29]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) id 1lrI7L-0006iN-Po for linux-f2fs-devel@lists.sourceforge.net; Thu, 10 Jun 2021 10:41:01 +0000 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BB0721FD47; Thu, 10 Jun 2021 10:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623321648; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e69p7cSpTPxrgycR/WxxaL+1l2Iy0njG9LV0PDer+c4=; b=WNzicnn9I9Uzi3rhrzU3g34rvVnvDxp/dzgOfJ8QelNeJaO+n3iduUNFK/9KFkm8z8EeQW NL1SjEN/b720E7re5xPsC8EubYb6b5KZXIu9/vLgcdL89PUhpyLXDk4QFY4xIwUI5aT9rc RHr+TtYt2pnBErVijdh7TG9nIRAFQQs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623321648; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e69p7cSpTPxrgycR/WxxaL+1l2Iy0njG9LV0PDer+c4=; b=ldzR16nIFLY7YSLUeT9j/700yV/caPCby06yFrv/SQbZy/V+JI6iP9FH6mfkFJSIwBuRfv KhEDZH21lxejVFDA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id 24988A3B8B; Thu, 10 Jun 2021 10:40:48 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id E025A1F2CAB; Thu, 10 Jun 2021 12:40:47 +0200 (CEST) Date: Thu, 10 Jun 2021 12:40:47 +0200 From: Jan Kara To: Ming Lei Message-ID: <20210610104047.GA23539@quack2.suse.cz> References: <20210607144631.8717-1-jack@suse.cz> <20210607145236.31852-1-jack@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Headers-End: 1lrI7L-0006iN-Po Subject: Re: [f2fs-dev] [PATCH 01/14] mm: Fix comments mentioning i_mutex X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , Dave Chinner , linux-mm@kvack.org, Christoph Hellwig , linux-cifs@vger.kernel.org, "Darrick J. Wong" , Hugh Dickins , Matthew Wilcox , Christoph Hellwig , linux-ext4@vger.kernel.org, Jaegeuk Kim , ceph-devel@vger.kernel.org, linux-xfs@vger.kernel.org, Damien Le Moal , Ted Tso , Miklos Szeredi , Jeff Layton , linux-f2fs-devel@lists.sourceforge.net, Steve French , linux-fsdevel@vger.kernel.org, Johannes Thumshirn Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Thu 10-06-21 17:06:41, Ming Lei wrote: > On Mon, Jun 07, 2021 at 04:52:11PM +0200, Jan Kara wrote: > > inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix > > comments still mentioning i_mutex. > > > > Reviewed-by: Christoph Hellwig > > Acked-by: Hugh Dickins > > Signed-off-by: Jan Kara > > --- > > ... > > > diff --git a/mm/rmap.c b/mm/rmap.c > > index 693a610e181d..a35cbbbded0d 100644 > > --- a/mm/rmap.c > > +++ b/mm/rmap.c > > @@ -20,9 +20,9 @@ > > /* > > * Lock ordering in mm: > > * > > - * inode->i_mutex (while writing or truncating, not reading or faulting) > > + * inode->i_rwsem (while writing or truncating, not reading or faulting) > > * mm->mmap_lock > > - * page->flags PG_locked (lock_page) * (see huegtlbfs below) > > + * page->flags PG_locked (lock_page) * (see hugetlbfs below) > > * hugetlbfs_i_mmap_rwsem_key (in huge_pmd_share) > > * mapping->i_mmap_rwsem > > * hugetlb_fault_mutex (hugetlbfs specific page fault mutex) > > @@ -41,7 +41,7 @@ > > * in arch-dependent flush_dcache_mmap_lock, > > * within bdi.wb->list_lock in __sync_single_inode) > > * > > - * anon_vma->rwsem,mapping->i_mutex (memory_failure, collect_procs_anon) > > + * anon_vma->rwsem,mapping->i_mmap_rwsem (memory_failure, collect_procs_anon) > > This one looks a typo. Actually it isn't a typo. Memory failure path doesn't touch inode->i_rwsem at all. It uses mapping->i_mmap_rwsem in collect_procs_file(). So perhaps the functions listed there should be updated to (collect_procs_anon(), collect_procs_file()) but the lock name change is IMO correct. Honza -- Jan Kara SUSE Labs, CR _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel