Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp413783ybk; Wed, 20 May 2020 02:53:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwydYKYWcxrUEHkiFLcCRH5y/NVdMocxS12GJz+cwNRCxpJCDDfnShQv97WJYhA3iae2l+d X-Received: by 2002:a50:b082:: with SMTP id j2mr2672716edd.201.1589968428220; Wed, 20 May 2020 02:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589968428; cv=none; d=google.com; s=arc-20160816; b=AluVf0OqRqCoz06IC8ZkvomjAOln81LBK8LcD6SXeRnKcSuuYvHEfF2MomXZQSzkyj +tZ2kMsAGB7F03tcpdsku73UIEOvUzoG6sMAVB50beyzlvDteh35cToYqpagkO2EOoja i988YJuUEYJKg72HMUNsoNOahLYVaHi1rzqfJUYc30nJ7EMBeaX9S65n2dSEgQa14kWH lulFNk6oZFUyOg69028kBWBt9nZ3YkBopo0GV0vo5O+cerBDRhT5rirypAcWV4M4DoTF lZLup80UouBGFENqkoFRimIvp+W1ZYJTsYFg5cO3CcirraST1vzRcvK35QTOOQN+juq8 H2Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=nevx7oZKHW7CX7fMiFTp6Y4miyV1sUSG95KjXLajEmY=; b=aJ8wUsq3RvzEHdHJNFzMXazpJNIWQbPq11RgPcRWXc9QYbN1xbE2wvXYsRaK6ZF/t1 Ry8xkFyg8ZD5N45tF7sqsN0HgT6wioV1Ls9MNXSMRHpOf9cm3k8wlnjcfv9Vly0MZO0H Vkmd7dUt58P8VCXK0BB1selxY2WDQuTTSpxd3uZkn9lvOf3BfibV0HdT500ap7OkkMK8 z7kQDAPF8JiFFU4/rPNgmQUebf9R3HhOZVdCfGKC1YXeQUnDU92PxsebQ9KdRgVCQ31i wblPpjkJ37dRuuSsTQRf8seymEfz0w5u62+nXGQC+DyK6SLV2ujaR+41ecVrzQwQowT6 i3Gw== 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 cx15si1130840edb.320.2020.05.20.02.53.25; Wed, 20 May 2020 02:53:48 -0700 (PDT) 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 S1726733AbgETJvx (ORCPT + 99 others); Wed, 20 May 2020 05:51:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:51402 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbgETJvx (ORCPT ); Wed, 20 May 2020 05:51:53 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! >