Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2821548imm; Wed, 16 May 2018 21:20:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp4mPIQQMK3oFsC4m4u7njtsedi5kG79Njh8tZLDg6Xo9bi9h2/eBQXZVGWLjFvLfg6RJFs X-Received: by 2002:a62:990f:: with SMTP id d15-v6mr3681217pfe.115.1526530813744; Wed, 16 May 2018 21:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526530813; cv=none; d=google.com; s=arc-20160816; b=WrIOHL97poBcn4T33cOfEwbHRU2RMjdaRIk1V4E3SoOXv6rJRNINSQ51EarEgONmDk ZyraKJJAbRL/mHn9FuFjSiK5B633CWYlJmyd0iVpaUyQq0Iu0nlWxNXJ0yYDGOjErDh2 LeNUhu17/N2sxWF4oANXVf7jmCM1vxgsj/5jqpNNhz1kTZcAY8Selgm2h666FTngFib+ cSUviQpBhv5Tl9DW3aBJYcceJ7woCcGgqYFEj3cPRfLTjkZnPg7BxTmEqT1pd7xQuBI6 gy7r0SsZEDx08zFoJ/gbisTQ0LHREIQ9PxXJjF1eIaJPia/38E8YgiZKgcxFMHB1/3gj 2CMQ== 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=2pp2chqmjFmQxChznwU9UoAfsuNHH9yaqu92zCG1Dfo=; b=EzkwlGkMVkAGlqbMwArMu3lFy3ce4o9dEYyYiVluRJy6s4M/pQ5/wmqjnBoZKSwDWQ rlCVZBdPOlpECiaB3P1rkGYDKK9aqxAS91NusH0KpjWagCrZYneVf+y60NJdRtAksxr5 F2v2qa4b7uffJSo5cEx19gi5VAbXoV1KACG5Xm3jfuVuFav6dGiOcRvjHw6u70riFm8U CYtIbp8yswHcL4QtrjiGgDdMinhPq+czm5NZKniZc99LRpJ6ztfG0N8LmUCi8jQL/rec US/k7ZraYqIvx85RV4QqHXVAAQnCBrLKwyoqDV45a9HmJhW5tY5qKjf3y9xcswfM5sX4 U3Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ruO58sGd; 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 k1-v6si3319641pgt.325.2018.05.16.21.19.59; Wed, 16 May 2018 21:20:13 -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=ruO58sGd; 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 S1751999AbeEQEQl (ORCPT + 99 others); Thu, 17 May 2018 00:16:41 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:37950 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751595AbeEQEQj (ORCPT ); Thu, 17 May 2018 00:16:39 -0400 Received: by mail-lf0-f68.google.com with SMTP id z142-v6so6631283lff.5 for ; Wed, 16 May 2018 21:16:39 -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=2pp2chqmjFmQxChznwU9UoAfsuNHH9yaqu92zCG1Dfo=; b=ruO58sGdEiFeJJ72YnWKVmkqPBgqTK/3Z9+D7mFv1K7o2vx0dwVaoOo575MKOgpbhL 1WmEhVcgI2T/lOpPbgqlatdq6FYK9D2Jh0vUKffIJj2JzztPRa/X4riK4XRiIW/7tKwf A9WHyWA1wsSVnin+SICOavnbW7qpNJYNA9bVUpYwmv2rU7iHkfrqnzBhDtL2iBt+3PBI l/wjIeYRW8ERwRD6Vg9K714q805pvpHpvkYEcaha4VvysTJiZAUxK/XUxA6n7P4mPTQC biXPz5TZ6haznZy1oF1ACQaSMzhYJs30NBt7RUUA1UxTLHUCCkeKdexAL2w3SefJ/Krp ZxCw== 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=2pp2chqmjFmQxChznwU9UoAfsuNHH9yaqu92zCG1Dfo=; b=qjVjKIFbsTDbXa3C2MfAbqlWXRhoXmc8qZeu47zwuRS3umOKvP46Cu/G85kmg0smKP Bs2AbWFSTnEwwbuEMd3/UlfhDYWVXDDTTZufDTlvO5FK3h5YWRZ9JSfQ3nj80nSqQIzZ sAO3wDC9g+f4ixamC6QQJTBMqj7uj6i+ABxvvuqdp9+H3cahDRBQC69uVMrQk7Tv+rha gx4iA+q7oWYOb0qVPU+4SNNJUVExy7aZiGUJpOvImwb55Kr+jdlVTNsUyFCBRJU3dD6w UktvSkJ5zlvtxirM5/7M/PCwDmwVMbOf6ZaLEJdN38eCTBUnPCV6OVYCnLDXbhLioSnQ Xhsg== X-Gm-Message-State: ALKqPwdY9oIOSJz4B6KULqjvIaqmoevASNCvZsjWoXbT0zHEPPOvXHkS PIKRk/GpR1eSidLoq641dsQ= X-Received: by 2002:a19:2a08:: with SMTP id f8-v6mr16357329lfl.141.1526530598363; Wed, 16 May 2018 21:16:38 -0700 (PDT) Received: from esperanza (81.5.110.211.dhcp.mipt-telecom.ru. [81.5.110.211]) by smtp.gmail.com with ESMTPSA id n66-v6sm969260lfi.53.2018.05.16.21.16.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 21:16:37 -0700 (PDT) Date: Thu, 17 May 2018 07:16:34 +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 11/13] mm: Iterate only over charged shrinkers during memcg shrink_slab() Message-ID: <20180517041634.lgkym6gdctya3oq6@esperanza> References: <152594582808.22949.8353313986092337675.stgit@localhost.localdomain> <152594603565.22949.12428911301395699065.stgit@localhost.localdomain> <20180515054445.nhe4zigtelkois4p@esperanza> <5c0dbd12-8100-61a2-34fd-8878c57195a3@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c0dbd12-8100-61a2-34fd-8878c57195a3@virtuozzo.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 15, 2018 at 05:49:59PM +0300, Kirill Tkhai wrote: > >> @@ -589,13 +647,7 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, > >> .memcg = memcg, > >> }; > >> > >> - /* > >> - * If kernel memory accounting is disabled, we ignore > >> - * SHRINKER_MEMCG_AWARE flag and call all shrinkers > >> - * passing NULL for memcg. > >> - */ > >> - if (memcg_kmem_enabled() && > >> - !!memcg != !!(shrinker->flags & SHRINKER_MEMCG_AWARE)) > >> + if (!!memcg != !!(shrinker->flags & SHRINKER_MEMCG_AWARE)) > >> continue; > > > > I want this check gone. It's easy to achieve, actually - just remove the > > following lines from shrink_node() > > > > if (global_reclaim(sc)) > > shrink_slab(sc->gfp_mask, pgdat->node_id, NULL, > > sc->priority); > > This check is not related to the patchset. Yes, it is. This patch modifies shrink_slab which is used only by shrink_node. Simplifying shrink_node along the way looks right to me. > Let's don't mix everything in the single series of patches, because > after your last remarks it will grow at least up to 15 patches. Most of which are trivial so I don't see any problem here. > This patchset can't be responsible for everything. I don't understand why you balk at simplifying the code a bit while you are patching related functions anyway. > > >> > >> if (!(shrinker->flags & SHRINKER_NUMA_AWARE)) > >>