Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3076153pxu; Mon, 14 Dec 2020 20:14:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf/Z8N1XNZTSyuzL2qWMExCke0MxfJ3lfLyPEz+yw08XGnQguTbk/TSX9tb8/hUYu7ZnQ/ X-Received: by 2002:a17:906:8354:: with SMTP id b20mr25173281ejy.397.1608005671924; Mon, 14 Dec 2020 20:14:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608005671; cv=none; d=google.com; s=arc-20160816; b=Fq8GX9F2WBz7yaweQpzONPPbxXDYlb6dUqz273BIrs8G0kI98xGB31sZGoqfmg4R+2 rcpjNtrmxS509bv0/cvhg9vvfPTpwR0A9GDAVCh3mhHulK7SiH7HAXD3Ytr2+DqCrIGL AMn9wngqwaSXftU/NkzcyRQvKQHQVeVnX6eXrTwZ62MMx4yJIYDAiWI+FZhWSvZzupfG PuONF6DXoTLK9Mn6mZkTQO33OqKjay00YauDrJbJcAA+A/G9zlxL7WG6bMzm024x1qlV y4wa9cu+MSr0y7C8V1BPGZqvCa6qRKIP32MKGQAzFnqKGpKDdcQe/anzJSjvsUmMmKGv cK2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=46ZSjsUPcWVyCh/ErblSPIgAtEwkQRo3tckEXwS7qTM=; b=NChMjzUbxqiCszVnSNu8mJQJfVlUUTLO0fGUD8ijH+TfnGQMnmiqICjJzcLHzDfL46 YXhktwwKFzmmeeZFPmBE695KA7ZP7DAQEJ8zyFEZv8YRfSG+uFv8xRKqM8/u7+oRWLsj qk89M92z5WX0pdMmkUjBNapHk5FgpoBL0Ejp9jkaPfCCC5GIwGoJynDT6cfsKdQLH+gt trG+X4zec2h0ETxidXScRK3yBG1IQXhXvgJT6/Xfwqn62s1ulmb4cVLr6f45YWJ6tD0k nEeKug1dgiQtWiLieCUjSZ3aBNXKXvMeCOeSJt2NZySrq8v+22tQBVaMNLsvQfAKPbg+ BXYg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gn22si262528ejc.749.2020.12.14.20.14.09; Mon, 14 Dec 2020 20:14:31 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726096AbgLOCK4 (ORCPT + 99 others); Mon, 14 Dec 2020 21:10:56 -0500 Received: from mail110.syd.optusnet.com.au ([211.29.132.97]:60464 "EHLO mail110.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbgLOCKq (ORCPT ); Mon, 14 Dec 2020 21:10:46 -0500 Received: from dread.disaster.area (pa49-179-6-140.pa.nsw.optusnet.com.au [49.179.6.140]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 1595010FB9C; Tue, 15 Dec 2020 13:09:58 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1kozmn-0044DU-HT; Tue, 15 Dec 2020 13:09:57 +1100 Date: Tue, 15 Dec 2020 13:09:57 +1100 From: Dave Chinner To: Yang Shi Cc: guro@fb.com, ktkhai@virtuozzo.com, shakeelb@google.com, hannes@cmpxchg.org, mhocko@suse.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [v2 PATCH 2/9] mm: memcontrol: use shrinker_rwsem to protect shrinker_maps allocation Message-ID: <20201215020957.GK3913616@dread.disaster.area> References: <20201214223722.232537-1-shy828301@gmail.com> <20201214223722.232537-3-shy828301@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201214223722.232537-3-shy828301@gmail.com> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=Ubgvt5aN c=1 sm=1 tr=0 cx=a_idp_d a=uDU3YIYVKEaHT0eX+MXYOQ==:117 a=uDU3YIYVKEaHT0eX+MXYOQ==:17 a=kj9zAlcOel0A:10 a=zTNgK-yGK50A:10 a=7-415B0cAAAA:8 a=gf8vwYzWqZnQ8oCTc0cA:9 a=CjuIK1q_8ugA:10 a=-RoEEKskQ1sA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 02:37:15PM -0800, Yang Shi wrote: > Since memcg_shrinker_map_size just can be changd under holding shrinker_rwsem > exclusively, the read side can be protected by holding read lock, so it sounds > superfluous to have a dedicated mutex. I'm not sure this is a good idea. This couples the shrinker infrastructure to internal details of how cgroups are initialised and managed. Sure, certain operations might be done in certain shrinker lock contexts, but that doesn't mean we should share global locks across otherwise independent subsystems.... Cheers, Dave. -- Dave Chinner david@fromorbit.com