From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8614BC433E1 for ; Wed, 20 May 2020 09:51:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4F3DF2070A for ; Wed, 20 May 2020 09:51:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F3DF2070A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D987580007; Wed, 20 May 2020 05:51:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2136900002; Wed, 20 May 2020 05:51:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C0FB880007; Wed, 20 May 2020 05:51:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id AA9C4900002 for ; Wed, 20 May 2020 05:51:54 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 647AE181AEF23 for ; Wed, 20 May 2020 09:51:54 +0000 (UTC) X-FDA: 76836630948.05.dust08_2daf400f6553f X-HE-Tag: dust08_2daf400f6553f X-Filterd-Recvd-Size: 2923 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 May 2020 09:51:53 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B6D1AAC49; Wed, 20 May 2020 09:51:54 +0000 (UTC) Subject: Re: [PATCH v3 04/19] mm: slub: implement SLUB version of obj_to_index() To: Roman Gushchin , Christopher Lameter Cc: Andrew Morton , Johannes Weiner , Michal Hocko , linux-mm@kvack.org, kernel-team@fb.com, linux-kernel@vger.kernel.org References: <20200423000530.GA63356@carbon.lan> <20200425024625.GA107755@carbon.lan> <20200427164638.GC114719@carbon.DHCP.thefacebook.com> <20200430171558.GA339283@carbon.dhcp.thefacebook.com> <20200504182922.GA20009@carbon.dhcp.thefacebook.com> <20200513005741.GA67541@carbon.dhcp.thefacebook.com> From: Vlastimil Babka Message-ID: <88972cc2-2120-4257-ae8d-141e014c54e4@suse.cz> Date: Wed, 20 May 2020 11:51:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200513005741.GA67541@carbon.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/13/20 2:57 AM, Roman Gushchin wrote: > > Btw, I'm trying to build up a prototype with an embedded memcg pointer, > but it seems to be way more tricky than I thought. It requires changes to > shrinkers (as they rely on getting the memcg pointer by an arbitrary > kernel address, not necessarily aligned to the head of slab allocation), > figuring out cache merging, adding SLAB support, natural alignment of > kmallocs etc. Is the natural alignment of kmallocs a problem right now? As kmalloc() allocations are AFAIK not kmemcg-accounted? Or does your implementation add memcg awareness to everything, even if non-__GFP_ACCOUNT allocations just get a root memcg pointer? > Figuring out all these details will likely take several weeks, so the whole > thing will be delayed for one-two major releases (in the best case). Given that > the current implementation saves ~40% of slab memory, I think there is some value > in delivering it as it is. So I wonder if the idea of embedding the pointer > should be considered a blocker, or it can be implemented of top of the proposed > code (given it's not a user-facing api or something like this)? > > Thanks! >