Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3760119pxb; Tue, 26 Jan 2021 04:10:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzE+hVTgWNGEow1eAiIsJnvBr6dzkeDWMGVREcsTCQyckVcBkrG2Mzr1MhyWrI8n9KdYYUQ X-Received: by 2002:a17:906:1a0c:: with SMTP id i12mr3378768ejf.325.1611663043702; Tue, 26 Jan 2021 04:10:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663043; cv=none; d=google.com; s=arc-20160816; b=l+fXDgr7VeCEqULao47v6AB5hUiWg09hQ3kbvnkULF09spNrihNVQ9xCT6OXL7XoEx y/h4TLriIcEYC5Jr/B+nGg3O3y9AZg/KYvHsU7fFSPAOwihupWe10t8dW2v5fDRZteTw S0TCnPEyszHx+OTPlYIn22YR09Kj/RKdv4cgaBLJkiNuAj6JU8FYwpvnIlIoEznD6vCc rZVFwvzoOyH3vCw11Y9GK6IUAtNZH8y9oTdAoHVmJ+VlrB1rSG7xEK04pKkG9O9pzp6G 1WZ+HVfJPqNeoogdXfkhqJEz6iIfx44+Xodl+k9ria9HvA1OwF9QvVBFW6erOtT/p14r aPuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=ETQxWmxPl3XZvdgMyLgaqK4igUfcz1cupgVw8FNmfmE=; b=XSCy33a6GLENk7nYqc8nZH0FoMctJMwUUjCVeVTGwrwvWz4onAolZBAeQ2ckSFV2se 92LJQ3smay3eJQEy2fzGXB3Up1L6JT3wTIlMFM0vnfBNW5i3oNkWVKqtiKjv8DElf01Y uNh6U8cGJUNJqJJUkuye6JZR+1hEX124R/aM7DyzxkFwqOBNvpr09WImBwS1gtbaXcZX Zr54ddXLsXr56JcqfH70Mfzl1tYaZRm4NDRD+nMERp0yg9Ek5p9snWGvkHklXrcgdE/4 kvcpTG0StyUm0TsxOM3wsQ7ZHvfwSBYXrY10mzwZ1h4REJ1czOJPbFnqXuyzfDn1k2mT ryWg== 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 z62si2985288ede.499.2021.01.26.04.10.19; Tue, 26 Jan 2021 04:10:43 -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 S2392349AbhAZMHU (ORCPT + 99 others); Tue, 26 Jan 2021 07:07:20 -0500 Received: from mx2.suse.de ([195.135.220.15]:59832 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391345AbhAZMHR (ORCPT ); Tue, 26 Jan 2021 07:07:17 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 47318B92F; Tue, 26 Jan 2021 12:06:36 +0000 (UTC) To: Roman Gushchin Cc: akpm@linux-foundation.org, bigeasy@linutronix.de, cl@linux.com, hannes@cmpxchg.org, iamjoonsoo.kim@lge.com, jannh@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, minchan@kernel.org, penberg@kernel.org, rientjes@google.com, shakeelb@google.com, surenb@google.com, tglx@linutronix.de References: <20210121172154.27580-1-vbabka@suse.cz> <20210121172154.27580-2-vbabka@suse.cz> <20210122004847.GA25567@carbon.dhcp.thefacebook.com> From: Vlastimil Babka Subject: Re: [RFC 2/2] mm, slub: add shrinker to reclaim cached slabs Message-ID: <51de513a-9c4e-35fa-fd04-977480ac50a0@suse.cz> Date: Tue, 26 Jan 2021 13:06:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210122004847.GA25567@carbon.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/21 1:48 AM, Roman Gushchin wrote: > On Thu, Jan 21, 2021 at 06:21:54PM +0100, Vlastimil Babka wrote: > > Hi Vlastimil! > > This makes a lot of sense, however it looks a bit as an overkill to me (on 5.9+). > Isn't limiting a number of pages (instead of number of objects) sufficient on 5.9+? It would help, but fundamentally there can still be a lot of memory locked up with e.g. many CPU's. We should have a way to flush this automatically, like for other cached things. > If not, maybe we can limit the shrinking to the pre-OOM condition? > Do we really need to trip it constantly? The priority could be reduced, pre-OOM might be too extreme. Why reclaim e.g. actually used LRU pages instead of unused slab pages? IMHO a frequently reclaiming system probably doesn't benefit from SLUB's peak performance at that point anyway... > Thanks! >