Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2182426ybi; Thu, 18 Jul 2019 04:40:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwL6NUrEDnkSmwWx3ir5mAE43j9jSw7hz+oa50S9KPzzdltTpHUDu6jvYdq2jmuDwHERDK X-Received: by 2002:a17:902:7407:: with SMTP id g7mr50089592pll.214.1563450031348; Thu, 18 Jul 2019 04:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563450031; cv=none; d=google.com; s=arc-20160816; b=NRFsWx/LnpjRCCdhXwyLUkcNELU4gvatGuKQ73CAr5Mrw4AQt1CTip8Ot+4+lB23Ql /SJ0Trrr6SFOVSQOaghCyjUyX7MoxXjgIFG/BSFARgAw4pBex2ba3bFPqLpODHOo/DZr f18AuMdHE5dUklRQcs3kirzON6KMOIprJ8kW9tvIQC2yoAy5tFjt1RSuvKW2BMvbGBzu NBQhTVfecWVWKGaXz5HPEAFAymrBID15x6Dapxlm1xcyVdG8ZzZ9f2WCAjNONXi5gl6L rE3RK6g8VBCW8XNt2+6cm9c47iueXFwofjx3rKrptjV8cus6Q8j5vtEIGVvKLiAhClfl CaaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=5h7nc3ShpN2HZMYYeZJQM9eacq48yLOThoJ1TPGlT9U=; b=rKpu4yaEUWwfKxQpPFDr0TAb9fBRBCdrRaVHqZKCL6Qr8EaXtt78O4PAPWPgTD+TU2 PtqLbepIax4Lan8emJTM9G1eghXyE52a7ULXULRCTCahYQaIbhtAfuF55Q7ibXusO0x2 fIV2q6e8hB8aTl1dpVaTASZsjPgAOJOeTvY6Z7pOIojPqP3o3u8I/SQMForVc0EeqHyU A8jirwrqua12cgqS9J+4ckSACr9xAErtJC3r9BdJH9bcX7XBpc5NnIMtaGke4H+ClHzj bfOQHuDadvrmf5i1C7Y9KGTChNdxlzIOEdXjBt77aYm0XoGYAP4ffPSKNY3g2jPaM/Ey qekg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=m9aJEqB6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8si824170plb.420.2019.07.18.04.40.14; Thu, 18 Jul 2019 04:40:31 -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=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=m9aJEqB6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390152AbfGRLiM (ORCPT + 99 others); Thu, 18 Jul 2019 07:38:12 -0400 Received: from a9-46.smtp-out.amazonses.com ([54.240.9.46]:45164 "EHLO a9-46.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727740AbfGRLiM (ORCPT ); Thu, 18 Jul 2019 07:38:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1563449891; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=xWVA8lsMEzKAdMagd2kfoiEHBMGzewwRgNqmEIy/2Rw=; b=m9aJEqB6b/1X8K3XpFwzGXp3UjJognrWDaP+nhgc5YMHZPUQ+jV84Zilt5nBS0t8 zn0b1O7AYnfXJvggzlsCa4XZ+C22Gj2jzs90cUpCPwdPcSeeznIrScvUIUt5uO5Jxk3 whHhZdArsxSZAJUEkRzOim1yrj1Y0H/kKp1TBUPI= Date: Thu, 18 Jul 2019 11:38:11 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Waiman Long cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Roman Gushchin , Johannes Weiner , Shakeel Butt , Vladimir Davydov Subject: Re: [PATCH v2 1/2] mm, slab: Extend slab/shrink to shrink all memcg caches In-Reply-To: <20190717202413.13237-2-longman@redhat.com> Message-ID: <0100016c04e0192f-299df02d-a35f-46db-9833-37ba7a01f5f0-000000@email.amazonses.com> References: <20190717202413.13237-1-longman@redhat.com> <20190717202413.13237-2-longman@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.07.18-54.240.9.46 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Jul 2019, Waiman Long wrote: > Currently, a value of '1" is written to /sys/kernel/slab//shrink > file to shrink the slab by flushing out all the per-cpu slabs and free > slabs in partial lists. This can be useful to squeeze out a bit more memory > under extreme condition as well as making the active object counts in > /proc/slabinfo more accurate. Acked-by: Christoph Lameter > # grep task_struct /proc/slabinfo > task_struct 53137 53192 4288 61 4 : tunables 0 0 > 0 : slabdata 872 872 0 > # grep "^S[lRU]" /proc/meminfo > Slab: 3936832 kB > SReclaimable: 399104 kB > SUnreclaim: 3537728 kB > > After shrinking slabs: > > # grep "^S[lRU]" /proc/meminfo > Slab: 1356288 kB > SReclaimable: 263296 kB > SUnreclaim: 1092992 kB Well another indicator that it may not be a good decision to replicate the whole set of slabs for each memcg. Migrate the memcg ownership into the objects may allow the use of the same slab cache. In particular together with the slab migration patches this may be a viable way to reduce memory consumption.