Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3376814imm; Sun, 13 May 2018 09:58:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZooh9LNFhExGAejTcESZObNXtSjp51aKPYuz1Y4QUT/lF51ipdNo4Ep5GIJ23x0eIpp7daS X-Received: by 2002:a65:661a:: with SMTP id w26-v6mr5827744pgv.151.1526230705891; Sun, 13 May 2018 09:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526230705; cv=none; d=google.com; s=arc-20160816; b=l1Ks6dmrLJKYw3NUoSkTMw/cVht8/AK45aL4YkHMJA68DU8/ZvYC/qtASH7LcriMPU i1Br/PGgV/OB+wDs9YCL+isgtdeyVr1ND1YXokbHP68m9amKA6jWF68VijeTVlDYRI/b gpiGLfAJ/FJAfqgsKbYx44yPqZsImG1JVp5/Eweph1EfchC9oHD5hMQ+iSibR3C+840T H7bkfVUZS5izXeQNcL/K17jRYfUFMlGq6yAWDQi6NPJNMdU3AhsVMF+thVn+sgpJFi/x zSXKVUp1ubFx8mj6+QVA5Lp9G7n/Ox1pNpk2OjMsMxd4he/ckY08yCeE1+oHsuGMsbzs mVMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=bkbro8PbJe+1XM+xFdSPG6FOgCehkVNIBDorUTzgGXs=; b=lmDP73KMFnNGIoN19hXBPlacwGbOFqYAoQC0pfi4NhFSumERs4XuIzPhgp/K1tR+3a mc4dDdP3U8HRMHUegzgSyEzNTYn5Ge7asLdrWcTqtf1J42hGShN70okO6k1DKI3+835f 2uwEMGgsSP4lo7VrZGuXkaFTrnnq3FhFqPXH52iLbj5niuYAJuHtsL3AdXqV1OZ9jR3S VFu/PFCsm1r2SA4P+FSfhEktwz5OVK/Vw68IEWIYIEljbYo3rJTsfYlzJhM/wiP/xE6r AF8O0ZfWYmEYafiO/tLBMM5Vpcxj/FYjPmzPLl/Vc+ttRaEDYKeYZ8wDzvW77Ey1gtJD FYgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BgjUGpan; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62-v6si7943032pfg.218.2018.05.13.09.58.10; Sun, 13 May 2018 09:58:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BgjUGpan; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbeEMQ6C (ORCPT + 99 others); Sun, 13 May 2018 12:58:02 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:44272 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbeEMQ6A (ORCPT ); Sun, 13 May 2018 12:58:00 -0400 Received: by mail-qk0-f196.google.com with SMTP id z8-v6so8195051qki.11 for ; Sun, 13 May 2018 09:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bkbro8PbJe+1XM+xFdSPG6FOgCehkVNIBDorUTzgGXs=; b=BgjUGpanez1HLvRysSUtWRjqBoI7u3EhzbLmPHRL6FAASyd3/h6fQibSvaRjITBUQS j91yE0m7tFmEK57ShQ6QdCludeKjlfqT+Ms4hc6SVVlXA53GehhlEkfdVOLCdmm42VHi 4Yq5+QeDcksDu8fjJGul7lAUEyEzcUeq9uI6DB72z6jPkeo4lMIUBlJFx2mifd5SVmWK X3PWLzD4lwUF4A/LSs6mCkkYazhIWpeRs9WIOZxsJjoU4nINPKHfFtDPzT6fSVquEGIf wNVZqEe5S5S6aqIfzJV0lbCchOM8Ix3kjWkeOLkauiMvBriXEY8dOxZf40zTJNRIBfeJ 8apw== 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=bkbro8PbJe+1XM+xFdSPG6FOgCehkVNIBDorUTzgGXs=; b=sInmff88PxCwVDMpCz9WVfPYz+0Flbgf8gNgCv68wetHtpH3wr6iT1CzIxZgOTeVK0 FbnEEjNO9Jz4QOfQwS6mZYIXKXdWOXgTAEA3tiWukRHKRP6ZJqjWCYalTeAwPjDmFUms AIBMyAYyuQ55ySONKSv67jUfyw/sS6x5p1ohdUrDYno6wG/Eu0pKQFOLlTN+MCJOS1qV 6DG8Ez5g5z303G1R6D9NIGm49oG7vtjJQ3YvQ4I4QI/biUh9q0wxfGhS44C/COcA+KQP b0EELhjiLLAru9Oz7ViJpmIWkENuuU5AwO03EM//JIARYfqzuDrFcJ49spCNm8Lxyfgj 7Tog== X-Gm-Message-State: ALKqPwcX24W03vSjcVHq36G/JrlBAk91t8HC5HfcoKb65U7hv2lt052l 8Y/eeOYFkhCCSC4L95vxfIA= X-Received: by 2002:a37:2162:: with SMTP id h95-v6mr5388888qkh.443.1526230680273; Sun, 13 May 2018 09:58:00 -0700 (PDT) Received: from esperanza ([69.38.167.222]) by smtp.gmail.com with ESMTPSA id l5-v6sm5720408qtp.25.2018.05.13.09.57.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 May 2018 09:57:59 -0700 (PDT) Date: Sun, 13 May 2018 19:57:56 +0300 From: Vladimir Davydov To: Kirill Tkhai Cc: akpm@linux-foundation.org, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, tglx@linutronix.de, pombredanne@nexb.com, stummala@codeaurora.org, gregkh@linuxfoundation.org, sfr@canb.auug.org.au, guro@fb.com, mka@chromium.org, penguin-kernel@I-love.SAKURA.ne.jp, chris@chris-wilson.co.uk, longman@redhat.com, minchan@kernel.org, ying.huang@intel.com, mgorman@techsingularity.net, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, lirongqing@baidu.com, aryabinin@virtuozzo.com Subject: Re: [PATCH v5 06/13] fs: Propagate shrinker::id to list_lru Message-ID: <20180513165756.obsexfkvnyoylq6v@esperanza> References: <152594582808.22949.8353313986092337675.stgit@localhost.localdomain> <152594598693.22949.2394903594690437296.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152594598693.22949.2394903594690437296.stgit@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 10, 2018 at 12:53:06PM +0300, Kirill Tkhai wrote: > The patch adds list_lru::shrinker_id field, and populates > it by registered shrinker id. > > This will be used to set correct bit in memcg shrinkers > map by lru code in next patches, after there appeared > the first related to memcg element in list_lru. > > Signed-off-by: Kirill Tkhai > --- > fs/super.c | 4 ++++ > include/linux/list_lru.h | 3 +++ > mm/list_lru.c | 6 ++++++ > mm/workingset.c | 3 +++ > 4 files changed, 16 insertions(+) > > diff --git a/fs/super.c b/fs/super.c > index 2ccacb78f91c..dfa85e725e45 100644 > --- a/fs/super.c > +++ b/fs/super.c > @@ -258,6 +258,10 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags, > goto fail; > if (list_lru_init_memcg(&s->s_inode_lru)) > goto fail; > +#ifdef CONFIG_MEMCG_SHRINKER > + s->s_dentry_lru.shrinker_id = s->s_shrink.id; > + s->s_inode_lru.shrinker_id = s->s_shrink.id; > +#endif I don't like this. Can't you simply pass struct shrinker to list_lru_init_memcg() and let it extract the id?