Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1317026pxb; Wed, 10 Feb 2021 05:50:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbk7rGCtepBVNElD/eC/wtMWiTEMAuGQu+WajgZOGGVI+eKyDnu2vSeasEO54Lt24dVadB X-Received: by 2002:a17:906:dff1:: with SMTP id lc17mr2979992ejc.198.1612965040937; Wed, 10 Feb 2021 05:50:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612965040; cv=none; d=google.com; s=arc-20160816; b=iSpDUPz6bKlTqiFhPvX05h1//BdafePcR5V6OPuhiZmN/NdXDRmx37v7Q3c31Mr84/ l4KLmoY9Oq8FOiJgZCMJzvcZXhOo5GVccHVezBPNrAtPQRlcd5ktsHvYFtY5oflff9UT x2ODgalpgp+yG67buCJSujmXwY7/33weWGvvEZyhX3Ug9M6PowiLG+VOPuuQqOwbYYhF AfkKSy7F3Qh+2q2Mo8wd8mh8TdD6gA4lfn8pcYw3L2Gvg32gK9KbpFmdU7FukY/vNlcs ZetJE4w663vCvARy4ZX4/KRTl5dq1qkP+yy6nOuzXndmprWw/CzsGNvvkwv7sz+dMSKD r8XQ== 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=x7AQuIHqlGeDKdDmQaoPxTGljXqoMuKxFCh/+vT0i5k=; b=0wMEc1HAnbJP9f468wwGMwR3wU07EO7x9i/OqPhmcpMb9U8AsghYZ7Rsiw8Tk7+Bha kZX5WfMtdLSE4emNnfyBueePVTHkkefMnJx9+zd0SOj38wkgyIkc0tV4q9NpB3Omk+GQ fzmDoeFf8nUxp36VBgSzQCez7OyxyZJgimYH5EMgIvG9GsDw7duDtU86ykZLit1qRwkr 0JZonDupd6zZIjNgtBz4GNtLgQrUkMzobnT+CLgZh8MwbvpREz/YnlRIh2SgxZkKg58s 3epPbTzHmchsWRUjfp2OYPtNWVR5JWzcTAgzWtbMvCmoknMoPsFisEnPByQF09CnCucP 9ISQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nOGKWwEr; 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 d9si1339779ejz.720.2021.02.10.05.50.16; Wed, 10 Feb 2021 05:50:40 -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=@google.com header.s=20161025 header.b=nOGKWwEr; 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 S231208AbhBJNrt (ORCPT + 99 others); Wed, 10 Feb 2021 08:47:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbhBJNrr (ORCPT ); Wed, 10 Feb 2021 08:47:47 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B457C061756 for ; Wed, 10 Feb 2021 05:47:06 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id j19so2912615lfr.12 for ; Wed, 10 Feb 2021 05:47:06 -0800 (PST) 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=x7AQuIHqlGeDKdDmQaoPxTGljXqoMuKxFCh/+vT0i5k=; b=nOGKWwErjCXi0YFKi585FYnDqp7VZktLvttuvqdhK0nRwzl46aW1e6ZK2y4GhoJ9i8 KpIxBAdYnb+08xigU5i30VZuFTrxH9hEDGhvwYEsy/vXJ20y3z8qmZGxB570y+8nwDXr KqRlvpUxKhal/kP45OJ60gFtDUeeffZe8T1LC5rRY+O2Fx+sJ5NgQqI1K5vhBdjd2A6B qJw8QKEDXZMZlFJvt+pc5moGlNUZkY9BSRYZmVwipRgXbnYqLGFJEc+CMn2+gVC3m7gE 4OfOhMBxuIem8mVWHVp+YR/xI5Pyv3MgEexPFS4XvAKqbFwqVEoJy6zxsM+1KZMJkXNM BJVw== 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=x7AQuIHqlGeDKdDmQaoPxTGljXqoMuKxFCh/+vT0i5k=; b=OAUNVMlyKKVG/id7So51+D3siZSp8TmZ7lgzDV477xTHnxDqtdd37a0Ue2rtkj/vQk ttDeE36RmjRdv8U/C7t4f5x3FxO9goBwsDeHbLEixvxgH2mCnc/wAyDoin/uBd5a41Ku 1Laqvl/O4lHMkgPEXW5gIOX5hCFDMpz5wMGHhR6qQlVecNIR5eveoNFB8Y9yjtWV6HqU mjm4eDaWCX5e2QPPiu4Pl/OZmT/uvs952U+mpvtGuTAJEG1VNzpr35QqJXFhHQd7/EKV SL927Y7ZVPCwyJYDbJ2V6QECM1DsrPCA+XQCuyJfhsG2/QLkyT9e9C1u2AFC4ijec3Rs hcRA== X-Gm-Message-State: AOAM530b7J30+vItUYjzMuv7R+5bT4oAqoJ3cjayQsbmRChXY+sa1qWP eorp+y7d56FgvlxonNH8kim8CfN8rsTIoaFG0/Tb/A== X-Received: by 2002:a05:6512:6c6:: with SMTP id u6mr1722867lff.347.1612964822071; Wed, 10 Feb 2021 05:47:02 -0800 (PST) MIME-Version: 1.0 References: <20210209214543.112655-1-hannes@cmpxchg.org> In-Reply-To: <20210209214543.112655-1-hannes@cmpxchg.org> From: Shakeel Butt Date: Wed, 10 Feb 2021 05:46:51 -0800 Message-ID: Subject: Re: [PATCH] mm: page-writeback: simplify memcg handling in test_clear_page_writeback() To: Johannes Weiner Cc: Andrew Morton , Hugh Dickins , Michal Hocko , Roman Gushchin , Linux MM , Cgroups , LKML , Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 9, 2021 at 1:45 PM Johannes Weiner wrote: > > Page writeback doesn't hold a page reference, which allows truncate to > free a page the second PageWriteback is cleared. This used to require > special attention in test_clear_page_writeback(), where we had to be > careful not to rely on the unstable page->memcg binding and look up > all the necessary information before clearing the writeback flag. > > Since commit 073861ed77b6 ("mm: fix VM_BUG_ON(PageTail) and > BUG_ON(PageWriteback)") test_clear_page_writeback() is called with an > explicit reference on the page, and this dance is no longer needed. > > Use unlock_page_memcg() and dec_lruvec_page_stat() directly. > > Signed-off-by: Johannes Weiner Reviewed-by: Shakeel Butt