Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3398335pxu; Tue, 15 Dec 2020 06:15:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLHp099E2aL7ygARqgdoVdBdsj4r7HsMlS4EJcVKE/r7+hb7/s3uk5gAQd2h5bb6IHdcAn X-Received: by 2002:a17:906:27d1:: with SMTP id k17mr27901885ejc.325.1608041729838; Tue, 15 Dec 2020 06:15:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608041729; cv=none; d=google.com; s=arc-20160816; b=Zk2Ws/5S9QHwm2gva7/yrQ6CkAq17nqiiTA7M6ayWacHetWa744KKHz1RD59eHycyr bBjq6PI/bitO3t0uJB1502CCMGNZmQn54jkOLATJ2xWNrFdA4ndTf2NbE9kxdXlZG4yh R8bfSb5f8UX558n3iQ0aNOysKy08iz9HWFTg4QPWZL6WT481t59h1DxqTH31i9+rBo44 C48O6IUV87yLRzXOdgCLeDS1elxE49EiF4Bbnl1DL3jYj+dRFGmG1gN8rk1FA0LzNeTQ LjLzHToST5OhTPCzlvMx9bNIdehC7PR9Mk38KhnNWUldkCX7M9ugwTtD9j0ykInExYIk Z3jQ== 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:dkim-signature; bh=NO1cdDn3rveUCdkxTy4K6Bz123za1ZPbmRLXpINNXFQ=; b=JQm+npgz/KEpoNRFC/1hWlP4SOJ4LSEUjC2nuSCyj1EYkF+bxdVOV2XdlMxQvMQA17 svKTdjDl+RfvRmo+2Z5I95IvstXGKKt8cj12q6NMDUjE63CfYQRRKL5p/HHZsb/j9GE6 aKbeRaGMIMbduU8qqqVnRE1TiyBcQDCWUyHv0qe2x+WviX/xaBHwLiBt3Y5JQVERhDjz fdP7UANZ/Xmgb31QBkaKLhC15+KXT+1Z4FaIKtnlHIqcSM9phlXS7BZ/Y5q/HyCfnIcY ++Zox2jm4h7rquuOxxwEP1PEvSxpGdGqxm/Ahiow3qVKzVvRABRvOI06pbPTlxIFMflc 2F3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=Cj5TDFrP; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a29si948162edm.401.2020.12.15.06.15.05; Tue, 15 Dec 2020 06:15:29 -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; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=Cj5TDFrP; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729355AbgLOOK5 (ORCPT + 99 others); Tue, 15 Dec 2020 09:10:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728648AbgLOOKp (ORCPT ); Tue, 15 Dec 2020 09:10:45 -0500 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A00C06179C for ; Tue, 15 Dec 2020 06:10:03 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id 6so13248875ejz.5 for ; Tue, 15 Dec 2020 06:10:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NO1cdDn3rveUCdkxTy4K6Bz123za1ZPbmRLXpINNXFQ=; b=Cj5TDFrP2UXo3tmwVUdTH7+GGb5RV0uPmO3jFGipk9hla1suqNd371yVeP25Rb7d8R 95thK+Kh0JbtyxNnRkK1QRrqiZ6+aDvVemT0KoFkKgrhdDhdeIjuWDIIBY1fJxz/XCAD 5GZ+TCH1ctDULr82sPdO6oNK483aeK/vBbo5gKWwqupJhRnSgpppS20wv5YTPvbMj/Ks oeCMBtDzYPiSCngc2EEZ7N5Qv1l88T9Ndv4Df6mkbk9phQGuT+4qPHBxfWzfQG2sW5Ra ipaEaUl9qeKnOtRDEfXw3a1Y+gzWybJBjz8NjbwoO4TpGQhICs7CJx6+gWBEE/GzU6JV jk6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NO1cdDn3rveUCdkxTy4K6Bz123za1ZPbmRLXpINNXFQ=; b=GJ2yN/gQGgYktmnl3Ga2fh7AEqZ2WeBc+LC4zW6fTug+9rTTtX3Cne/YxOZEIOL1UG JEr8/C+jQ0wowoZaic/n9vG+/wP12z4yAcZAWksRSxDC7sG1/MzeDoaTgcuEeWdTXmrl HyZ4SSt9QUXIQxQLd/TOz39msMRGVqLHHjeVjxfejFMREdYjbO9n/AfwuXurX50sX5J/ 2GH7EoT0mA7cKojDcffQJASq9dpPMUtIgh//bKkwX1YwqZvOlcJzHaRweuQuLS6bv9wx +yVpMmzfpjoyit9wU9h7Eik0kZ6NoVisd4p4zt7PUqWMd2npZhjOihzWCxdWp5+YX5wY vU0g== X-Gm-Message-State: AOAM531wxsylSgT1zEfMqJf4j5oUJnv80aMP/rX2CtkWcHtXauIJVn5w 19z4tL57k1GubYWC5HUEcPBjhg== X-Received: by 2002:a17:906:8587:: with SMTP id v7mr26396217ejx.381.1608041402353; Tue, 15 Dec 2020 06:10:02 -0800 (PST) Received: from localhost ([2620:10d:c093:400::5:d6dd]) by smtp.gmail.com with ESMTPSA id d4sm19109737edq.36.2020.12.15.06.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 06:10:01 -0800 (PST) Date: Tue, 15 Dec 2020 15:07:54 +0100 From: Johannes Weiner To: Yang Shi Cc: guro@fb.com, ktkhai@virtuozzo.com, shakeelb@google.com, david@fromorbit.com, 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: <20201215140754.GD379720@cmpxchg.org> 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> 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. This should not exacerbate the contention > to shrinker_rwsem since just one read side critical section is added. > > Signed-off-by: Yang Shi Acked-by: Johannes Weiner Thanks Yang, this is a step in the right direction. It would still be nice to also drop memcg_shrinker_map_size and (trivially) derive that value from shrinker_nr_max where necessary. It is duplicate state.