Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1014708pxf; Thu, 18 Mar 2021 18:04:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTTcF1O5QU9l7pAcgeSGN1krWyCSQnBLmRw67EiGsWRfvDSjoYhGlOjE9ij1ghSACThE7W X-Received: by 2002:a05:6402:1103:: with SMTP id u3mr6766469edv.205.1616115872803; Thu, 18 Mar 2021 18:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616115872; cv=none; d=google.com; s=arc-20160816; b=GABjCSUIidAhokoJwy4QXfnyXGSVvsC7PGZgw/PbD0DNcR5YlTw9faa3aWcymjT/YE J0vjE3mnGQX6G94ZO0ZFkPI9HdpRa/t9KaL6wkgTBLQtwrIyPv+/eSMwAC+ucR64Kt0C /it0DENbVc/MKPcS9ZorV1xpdQxuaM6xObvECHlffkBoJ8QZDv1RqCCRIrqIzxrCFo3W 3Ml0sc+WsYEbCSKiWp0Xa52r+GFNWV9i5TxG5pNcl1WtavHrymLCeOlIJF5+dJ58VNQo ygtBOQ3RlWNTp1Kvcr3JlzdXdFphp5kQDzNNK+IGJEJbqmhDRgL7yLZhAxiZc4+OVI2a EI1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AT07gM1d/snjyMuDSqF2iBtIXpjEUy5a43Ltdcejjg4=; b=XYB5M0W2/QGFfIQLKZF6Rkk54QodN6LVBZ+jg4AMLF2tRK44B4H/JohkxKBaBuiqlf i+iTe3ynKWVFesMUL6/aY0aAlBP9WyJee9vT1osZUyMHUef+F4VC7ou92pD44ylkBSjL OE+LqmffNifkscX7kEjsyypn4KEh+wLuA20cBtWQH9+BnNZG/rgUQSxJRYbRkmoAixAw 7KJ4taLYgoDoL6vhtZ4tUqHUEPB3dT63A0D7R7kr42wDBCdOgsaQHqcWRCOG717WXhk6 FEc6Q+SNoZoIsIGNVLjajemkmI+m6SD3p0RkMrgVfMEQ47P4gUDvaMWAAQm4h7Vv5qnU CgpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KM6wA1h7; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay20si2931950ejb.414.2021.03.18.18.04.08; Thu, 18 Mar 2021 18:04:32 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=KM6wA1h7; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233358AbhCSBBI (ORCPT + 99 others); Thu, 18 Mar 2021 21:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbhCSBAl (ORCPT ); Thu, 18 Mar 2021 21:00:41 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7207C06174A for ; Thu, 18 Mar 2021 18:00:40 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id m12so7459035lfq.10 for ; Thu, 18 Mar 2021 18:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AT07gM1d/snjyMuDSqF2iBtIXpjEUy5a43Ltdcejjg4=; b=KM6wA1h7XMgkD3D79Vjsw2MmDWvfXJ31KEsqyx2fIBaUvQGNEqgs6PpaVuPo3zKImT Q3tiRKlgQ9AUuBHHTBLPq17XL96zfVNc4/DfUrqyy6ZjSJeIre8PkiAezAxIMnTOk/ib mikaQN9tKxbtsEjCV7/vZJTSd+UzINRP34wFQqGixick42qAE3kFIBSAyoYYUsMtvzuh IsKjzY860tn7jQE8vSWi41A90uiZjxHqdgDT1yeoTS+wp84b5EYtwmyCsG2IJxD6lQ2Y /CqaoK5eGrqUrIOVqw5eeOPef+Rj7XuoWsuM1ytcZnfyZQFQnV+KsHD7Or1RXsgem1pM lBEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AT07gM1d/snjyMuDSqF2iBtIXpjEUy5a43Ltdcejjg4=; b=ZwaNGKAGfsH+P3N/c443lozAlxC6KPjTQkRF6b32HJWhLPgM9lBzomJRGdM/h92+u0 UYYmJKVvsFCFCMMeyXEFTvC2D/re6MDSa4na3lUUuPip4o7r/cP4YSgUoXGQPXwwvEvs DV34J6+tgk602QtODjG5IO/lhB5+FI+G3+Nuvm7UFJbv3lv/eAzC1x4ZYZq4YtoiStJH lB+U3cDLbS2SCHxmoX4x+9wZzEz/I1o0GAUrzdQbObFbk0XyYzSDbMPg9nwAnsfHmUeF 4agrpBROqvDtvLObvs4JEtgKoRq/R+faRJwRwEZc24uQLXa3+IJeHBokZfsYgw2Z9fUL DOYA== X-Gm-Message-State: AOAM5321GBaWRXsWWSx04yDVl0AgqxeXhMetmHtSduDUqaF5Py/5snKJ 8znZDIni4AKU10JZD6K55OcUP+uFUeyINyq0arpm0Q== X-Received: by 2002:a19:c14a:: with SMTP id r71mr6731527lff.358.1616115638843; Thu, 18 Mar 2021 18:00:38 -0700 (PDT) MIME-Version: 1.0 References: <20210318110658.60892-1-songmuchun@bytedance.com> <20210318110658.60892-3-songmuchun@bytedance.com> In-Reply-To: <20210318110658.60892-3-songmuchun@bytedance.com> From: Shakeel Butt Date: Thu, 18 Mar 2021 18:00:27 -0700 Message-ID: Subject: Re: [PATCH v4 2/5] mm: memcontrol: directly access page->memcg_data in mm/page_alloc.c To: Muchun Song Cc: Roman Gushchin , Johannes Weiner , Michal Hocko , Andrew Morton , Vladimir Davydov , LKML , Linux MM , Xiongchun duan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 18, 2021 at 4:08 AM Muchun Song wrote: > > The page_memcg() is not suitable for use by page_expected_state() and > page_bad_reason(). Because it can BUG_ON() for the slab pages when > CONFIG_DEBUG_VM is enabled. As neither lru, nor kmem, nor slab page > should have anything left in there by the time the page is freed, what > we care about is whether the value of page->memcg_data is 0. So just > directly access page->memcg_data here. > > Signed-off-by: Muchun Song Reviewed-by: Shakeel Butt