Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp959686pxb; Wed, 3 Mar 2021 22:34:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSfO6klC/DIDWb11a9DHEK1V10Zv9+MVYunTQ0gVWDsWXhBx6W4nce2QjKD5RnX0KV3aux X-Received: by 2002:a05:6402:888:: with SMTP id e8mr2637052edy.51.1614839664958; Wed, 03 Mar 2021 22:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839664; cv=none; d=google.com; s=arc-20160816; b=tuIrZmoCdnjDU3PAXjIgb7rc5UuCTEb9xWDgBnNeCeW63mcIMKgXLy7YUCN+8gedVw kiPlDgNCct8pEbmJOaZG85o4L5kXAOAQIECFcdtPh6iiWcK6nzjifQ8jxOYrcCtsSuxk Fan/DRKby/fvnY9Xp/g5sDQN2C6RkWuHcFPP9s56ZVwd3RliEt0Buzy+GvJqtapPAxBx 9ZiiJSwiZm7RXA2Svyl/5Pv6vtSgllKyoEiwnoOHluOHHY4Vk6uLCgMaV287h6m28JfU iX29b0rkEjortRilTuHKin0Lyl27aZ7S40I6+umE5dCPHxrk7cn4XPHQofAhRvlcc75M 2fiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=b+v3JZB+TwhS342xdPvs/fR2wMWd636mTWFjewLkIUI=; b=0yPV6BJyPHObNUTggX1G066od5rzsx3CdoSUfaFuO6K3x+BQNhNaY/rR/0StAk8gVC djdK66uyPcNuPSispunVQuLOb3CFeH72pUJoquH4AoVgHO9XgH0gep51oVpZKH5fYgpq m5z6eQzJEAd1Skrr5+IubzKbb6rF6ax1ykXcP/HiGvVhi3UaH/YNAyqIsvkqsOtb6lzl pNJ22ru1IfSHNrUNgQtPudjM0arhcEnF1SeKpEpGd6sGLqMhqoAJTYcnw8xlJ2KKvvcc FwzUcWXsZc+ieIIoz6wyTufSSYMK+AGk34Xf9WeFb81EmUG+X6YMuqAaAZhyqZNTMxd/ lXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mUUs7UU1; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si1844464ejk.478.2021.03.03.22.34.01; Wed, 03 Mar 2021 22:34:24 -0800 (PST) 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; dkim=pass header.i=@suse.com header.s=susede1 header.b=mUUs7UU1; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1581232AbhCBSl2 (ORCPT + 99 others); Tue, 2 Mar 2021 13:41:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:50854 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448880AbhCBPnP (ORCPT ); Tue, 2 Mar 2021 10:43:15 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1614699738; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b+v3JZB+TwhS342xdPvs/fR2wMWd636mTWFjewLkIUI=; b=mUUs7UU1AEU05j8mIPP2kTnHWvzCUUEnbJjR31FiubuqAp09labYpicraJ/+uBmPIxDI1a Ol2/VPk6YOjf3VXvfvjbxZBDWf48Qk939nbWOJ521kwmgFHZLwqmNUn4dH3iADkwt9d83d 1R1kuc0Z7VXNWoeIdshSOq5Y9L1bvIM= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 70575AE84; Tue, 2 Mar 2021 15:42:18 +0000 (UTC) Date: Tue, 2 Mar 2021 16:42:16 +0100 From: Michal Hocko To: Zi Yan Cc: "Zhouguanghui (OS Kernel)" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, "Wangkefeng (OS Kernel Lab)" , "Guohanjun (Hanjun Guo)" , Dingtianhong , Chenweilong , "Xiangrui (Euler)" , Johannes Weiner , Vladimir Davydov , Nicholas Piggin Subject: Re: [PATCH] mm/memcg: set memcg when split pages Message-ID: References: <20210302013451.118701-1-zhouguanghui1@huawei.com> <733264DE-1845-4615-8573-481E63895397@nvidia.com> <1E25514A-202B-48E6-97F2-1E02B0980A96@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1E25514A-202B-48E6-97F2-1E02B0980A96@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 02-03-21 10:37:13, Zi Yan wrote: [...] > I have a question on copy_page_memcg above. By reading __memcg_kmem_charge_page > and __memcg_kmem_uncharge_page, it seems to me that every single page requires > a css_get(&memcg->css) at charge time and a css_put(&memcg->css) at uncharge time. > But your copy_page_memcg does not do css_get for split subpages. Will it cause > memcg->css underflow when subpages are uncharged? yes, well spotted. I have completely missed that. This will also discard my comment on testing the memcg. -- Michal Hocko SUSE Labs