Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5277208ybi; Tue, 28 May 2019 10:16:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyaA8zN/zuu4QPKnFd6rGb0xRPGHuFMb14r8dwI/m41slzsEV5Yl8aLW8Iovo1xXWLH+8F X-Received: by 2002:a17:902:9a83:: with SMTP id w3mr11074877plp.184.1559063811028; Tue, 28 May 2019 10:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559063811; cv=none; d=google.com; s=arc-20160816; b=zNNyADNkFs9UTCYuHZzBuYgzrUGEVyoAjJqw8I3sKJammBacgxydGGQL/+QjCLRLXm KKIEJpwSmSEzbtHIu6t2mXciJxFQju+H75/Kv5zddGVw32OU22q7cjO7WadJ5I5aNvt+ cYj5GYUFVCn5l+4Gg8QehmitlOUALdmP6s1kgh1mnJWMM3SBEI4xkGrYD6IpEw1IynqB rED/0gQXL3BnxRU27LqsnB4E0hxhncP8tNuAccuTqVXNuAzIaULGEZyPH3T0TtojpL1V tC5c8Jl/QTB3+mhkYMy6YelGE/x9axDWSboPQDVE7NQQRuzETJtzuhbgE+h/iC83GvbX pvCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WjL1kPJpFZ+/6P/J2gFeO1EXLoFczY/0XpAxesm/SAI=; b=eBcAeXYyESctsmbTO6r556Mb/zsrMJX8BCHmTd9hWlNuMFg8HK/2v+ZBnP5zI/0BWt u64PctLCCBxO+S62ziX1Bxmi4zkXOFjhBWgSlWNrO3JME5/n9UqakdjWpiKf/9trwBsH MEmideCVWX3M8Dpkc5tdB4ogABAfTydZE6NHA16N5gsYN1st2NbmfNznWAaNQvu5VB3Q Ec4ZCJ15aaQcoHMRAFen5wTQPHRd47RM481ms5WuainVgBABcQnoJGZQinVigGx9DjZc d5fBZP8IL+2Zg6qn3vxorcIJKije8o8bVO6Q2IrALB1e3uwKYAMze1HALXf60JJyJ5Z4 wQjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X2EOagEp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si23822115pfh.227.2019.05.28.10.16.36; Tue, 28 May 2019 10:16:51 -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=@gmail.com header.s=20161025 header.b=X2EOagEp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727209AbfE1ROW (ORCPT + 99 others); Tue, 28 May 2019 13:14:22 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:43193 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbfE1ROV (ORCPT ); Tue, 28 May 2019 13:14:21 -0400 Received: by mail-lf1-f67.google.com with SMTP id u27so15205368lfg.10; Tue, 28 May 2019 10:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WjL1kPJpFZ+/6P/J2gFeO1EXLoFczY/0XpAxesm/SAI=; b=X2EOagEpclu4ci+J5hELZN56hZWa/YKEEJMK9pne6v5cmFWQgQ58z6hcuN4SKQZLrs 2LYlVt5tiD/iE7WqzRZ8jHNm0MmyqhWQEq2iiBv+DbERpI0KtlpIuMTL9yxGXn0AATbh 8S0dlssbwt0wAe9eMcKuq2YGU1jgdpZYeMbvwqLprQpHN3qxVNgQDU8vri2A537s8p// 4WiaEtaZRVBk3HrrAySnKiZf7QfTCHiQPbl3Qy0m6tUmkxDUBAoSxoVUsBGbuUEW8WH2 XoXsVF5Uid2iHAY8wQtjZ5v4ARPAKJRygdV96eXj2QnQS68LlFvJivE/aqEn0j6N9eNR yrbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WjL1kPJpFZ+/6P/J2gFeO1EXLoFczY/0XpAxesm/SAI=; b=J/+7FImhPXpE/ND2s+qd+RP1ihScvDVAGRddoQ0S0eGuhqIdhQIZluUqUzknK6EBSQ MK0x7CWQX/eus1Nhwo8eXDfghA9+PdZxzJSpdgTY96z+6UgFsACXDRciBz53sv39AHrE 2UT1eF5CwbZ0iBT2nEb2dnodkDNs6hoUrJJTON7n+fsbQhExlqJJKO5/FigrUq9vjtnX Ao5PKjvhBzw8Nl1ZySYlbMrlXGdml7ZKRwdiGXTsGPPzSXjoDQsY60UDtZHXgFnasw9r ng100DKtKR+nJJVrElU8tCqiaKFs1x53B0h9i6VUdj8h50ARdshE6kd63bdEl3hah8Za +AAw== X-Gm-Message-State: APjAAAUR9MCm74hDzr8fsxowI5/adyTi/oKSRmFngW+TlRWXcCCalAHE wcGj9Jo0z5F376rCyVCgK3QHFQ4042M= X-Received: by 2002:ac2:510b:: with SMTP id q11mr4381015lfb.11.1559063659938; Tue, 28 May 2019 10:14:19 -0700 (PDT) Received: from esperanza ([176.120.239.149]) by smtp.gmail.com with ESMTPSA id d68sm3014105lfg.23.2019.05.28.10.14.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 10:14:19 -0700 (PDT) Date: Tue, 28 May 2019 20:14:16 +0300 From: Vladimir Davydov To: Roman Gushchin Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Johannes Weiner , Michal Hocko , Rik van Riel , Shakeel Butt , Christoph Lameter , cgroups@vger.kernel.org, Waiman Long Subject: Re: [PATCH v5 1/7] mm: postpone kmem_cache memcg pointer initialization to memcg_link_cache() Message-ID: <20190528171416.ujwr5rhbo7g4wfd5@esperanza> References: <20190521200735.2603003-1-guro@fb.com> <20190521200735.2603003-2-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190521200735.2603003-2-guro@fb.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 01:07:29PM -0700, Roman Gushchin wrote: > Initialize kmem_cache->memcg_params.memcg pointer in > memcg_link_cache() rather than in init_memcg_params(). > > Once kmem_cache will hold a reference to the memory cgroup, > it will simplify the refcounting. > > For non-root kmem_caches memcg_link_cache() is always called > before the kmem_cache becomes visible to a user, so it's safe. > > Signed-off-by: Roman Gushchin > Reviewed-by: Shakeel Butt This one is a no-brainer. Acked-by: Vladimir Davydov Provided it's necessary for the rest of the series.