Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3434261ybd; Fri, 28 Jun 2019 08:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOY6ftzMAujYHYuYg1QMumvaAxjQY+fQnY+eMAYpxurEwMYCFo8UpwGt0rVGxtpGYn2P+x X-Received: by 2002:a17:902:102c:: with SMTP id b41mr12134517pla.204.1561735982878; Fri, 28 Jun 2019 08:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561735982; cv=none; d=google.com; s=arc-20160816; b=rzkieEKpKO9HZMNKHna1dq0iAJsjGuXUn86btvvyGaxQDcIuD4W/KBdTgD2Zj8mYsb lB8KbYSvUkSSOAmCupFuyc0lGKXEf6R+HC1p+zF4A8RVaHs+9/jW80iY2p1+ozD6Jfn3 jRhkV+VRqQ/h1L7jwe7Q2zEggs4m4GKpC8Nn0WSeCNiCRkYmlCeGUloiORJ7fsZgX0Ez 0OOi3lIxbTGBwbMQ75NmaQqDjnJ15CKCcCq7PfYDrRbROehBeU/mhmwdsdw8yv6H1lto kjuSNtK0B8womoGkkMZ/xZUexP1wKbj6tKs1UTVFzjxaOCeBDW7cnzzG1KWgqbZ5/3JT n71A== 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=AS0whl/EcrrVIjGmsUBB1P/c2zpIOxnuhHXncVKXZDs=; b=FHAcjcX93DaXZLdVH3vvdHhY5jMRuSKuBCw5wEKBV+/zAovEVTt6b83u/sboU6j9vk bPkC1FSsrDh1TI+Vjom+Im4VOrlPdPEp+RWhkNIhbU1eFOBdx6gI20PK2M4nKRvhaps3 w/cPVgark6KYK2H+8zabUQ+xzgZeOM3ZITpBX9pH4lJg2OiKN6Av+HJlwfxadxbmJ0xy 9YwEXTxLVau1dv1wmJLZ3kYsoFs8QKAZzBHj1jFEPGqa23FzCITgdHXHe94LUkPpkJrr PIrEKQ0vjufzNcXg7UpZy/pfVmao8h59CJ9f43Qf4T+Xe7TEgIVykdyU8yTSqMpxA0en ok4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=SPfGmsXF; 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 m68si2950544pfm.150.2019.06.28.08.32.45; Fri, 28 Jun 2019 08:33:02 -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=SPfGmsXF; 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 S1726867AbfF1Pca (ORCPT + 99 others); Fri, 28 Jun 2019 11:32:30 -0400 Received: from a9-30.smtp-out.amazonses.com ([54.240.9.30]:45750 "EHLO a9-30.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfF1Pc3 (ORCPT ); Fri, 28 Jun 2019 11:32:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1561735948; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=AS0whl/EcrrVIjGmsUBB1P/c2zpIOxnuhHXncVKXZDs=; b=SPfGmsXFLQEBn6h5ufA7w1jky3/Rc5RZWDgWNaiTM/EHlEN3OYChoYEFopmh0TVK CsfQ0V2VNWhAZKX5OVGAkkAuAJkc9V4P1tYZ2E+eFutc3svPaXxXsz0EOpjrjpx2KYK te37a4g49qMNkC2/MEGlyyhGG40MgUxZQUWAqOFo= Date: Fri, 28 Jun 2019 15:32:28 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Roman Gushchin cc: Waiman Long , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Alexander Viro , Jonathan Corbet , Luis Chamberlain , Kees Cook , Johannes Weiner , Michal Hocko , Vladimir Davydov , "linux-mm@kvack.org" , "linux-doc@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Shakeel Butt , Andrea Arcangeli Subject: Re: [PATCH 2/2] mm, slab: Extend vm/drop_caches to shrink kmem slabs In-Reply-To: <20190627212419.GA25233@tower.DHCP.thefacebook.com> Message-ID: <0100016b9eb7685e-0a5ab625-abb4-4e79-ab86-07744b1e4c3a-000000@email.amazonses.com> References: <20190624174219.25513-1-longman@redhat.com> <20190624174219.25513-3-longman@redhat.com> <20190626201900.GC24698@tower.DHCP.thefacebook.com> <063752b2-4f1a-d198-36e7-3e642d4fcf19@redhat.com> <20190627212419.GA25233@tower.DHCP.thefacebook.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.06.28-54.240.9.30 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 Thu, 27 Jun 2019, Roman Gushchin wrote: > so that objects belonging to different memory cgroups can share the same page > and kmem_caches. > > It's a fairly big change though. Could this be done at another level? Put a cgoup pointer into the corresponding structures and then go back to just a single kmen_cache for the system as a whole? You can still account them per cgroup and there will be no cleanup problem anymore. You could scan through a slab cache to remove the objects of a certain cgroup and then the fragmentation problem that cgroups create here will be handled by the slab allocators in the traditional way. The duplication of the kmem_cache was not designed into the allocators but bolted on later.