From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3CEAC433F5 for ; Fri, 27 May 2022 01:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232905AbiE0Bkg (ORCPT ); Thu, 26 May 2022 21:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232035AbiE0Bka (ORCPT ); Thu, 26 May 2022 21:40:30 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6E11C8BCF for ; Thu, 26 May 2022 18:40:29 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id n18so2916203plg.5 for ; Thu, 26 May 2022 18:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rsCeaKQYu2owUyCBDwtZbNFjRtUaibD4xCTBzD5NHwQ=; b=h5Os058/7Tkd1AvepTU0323lt2cG3mwUjYbiF3arFls/6rkKiXILKvCHrwLRQsySnZ 96/cCr2uqYFgpmz9nwuM3rG0f2J7xv5nQ0hqC6+iVv8nc4HgwHmTAlochAsZhfhqI83i saL36v4tANwGgUtHRDRXTByMQY8bwYbtQ/ll7KeQkIdOsJMyc1FvNm6aEzlzHG2k8jqo +V8bpsIxil8gc9piiCPIB8XYrUg5bo5kaXjbukdEC3xyym+MtICa2qY2Tcir2U37jJ1m 4ORO+Hu35zYgIWw/XT9PYNPw2QnLNZ1+Eb9F16UCV9gkZsq4Szql++3KR1rUZ5VhzQ/k YUJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rsCeaKQYu2owUyCBDwtZbNFjRtUaibD4xCTBzD5NHwQ=; b=uexQF+HnD0GR/h3IgkrqGy+2JUsSn0XGn2AvpogRaBkQvqeP6n4J7374zv4fIK/hny +YYkytaYFfyQUSzPpqtUePBxDigpZhCY/bTyoK4ANq1jdnkR7+K7hzrG0WChnvkIVJzx g5smaAzjJWWvqV/E++p7UzlXGPOzoNMjjFIUU98lchmZmoOT/akAr7irbsrzwGd2r/ym 9ejS5qEJX6yY3kvu/Ex0y68wqh7OjcNsMjkJM7wEZa471X9b2rwqHgUou5aFtKRKAhCe lVoYD4ocM6YWDRkAjff/Q/lI/hnLYrZzCA8z9NZnGyyyxa+fYQDz3kagGjRRptjO5U0F KQZQ== X-Gm-Message-State: AOAM530kZcZUr8Np8vulS5H2aPBiywaojyNouhb05rnR2QFG+5V3jGyt SxCliaF62UuQeOPIvKeW4hNlVkKmK3J+u4iPVJ41RA== X-Google-Smtp-Source: ABdhPJzk910Eqiuu/69sbIFt/rEQ4I6MtCDwrXFQ/nJqkbUlb/6Ny4mXvfFnPS95wsU6a5b8EAwIeusUd82ItqgJ2NA= X-Received: by 2002:a17:902:b58b:b0:162:2e01:9442 with SMTP id a11-20020a170902b58b00b001622e019442mr20257616pls.6.1653615629019; Thu, 26 May 2022 18:40:29 -0700 (PDT) MIME-Version: 1.0 References: <348dc099-737d-94ba-55ad-2db285084c73@openvz.org> In-Reply-To: From: Shakeel Butt Date: Thu, 26 May 2022 18:40:18 -0700 Message-ID: Subject: Re: [PATCH] XArray: handle XA_FLAGS_ACCOUNT in xas_split_alloc To: Matthew Wilcox Cc: Vasily Averin , kernel@openvz.org, LKML , linux-fsdevel , Johannes Weiner Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 26, 2022 at 6:21 PM Matthew Wilcox wrote: > > On Wed, May 25, 2022 at 11:26:37AM +0300, Vasily Averin wrote: > > Commit 7b785645e8f1 ("mm: fix page cache convergence regression") > > added support of new XA_FLAGS_ACCOUNT flag into all Xarray allocation > > functions. Later commit 8fc75643c5e1 ("XArray: add xas_split") > > introduced xas_split_alloc() but missed about XA_FLAGS_ACCOUNT > > processing. > > Thanks, Vasily. > > Johannes, Shakeel, is this right? I don't fully understand the accounting > stuff. > If called from __filemap_add_folio() then this is correct. However from split_huge_page_to_list(), we can not use the memcg from current as that codepath is called from reclaim which can be triggered by processes of other memcgs. > > Signed-off-by: Vasily Averin > > --- > > lib/xarray.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/lib/xarray.c b/lib/xarray.c > > index 54e646e8e6ee..5f5b42e6f842 100644 > > --- a/lib/xarray.c > > +++ b/lib/xarray.c > > @@ -1013,6 +1013,8 @@ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order, > > if (xas->xa_shift + XA_CHUNK_SHIFT > order) > > return; > > > > + if (xas->xa->xa_flags & XA_FLAGS_ACCOUNT) > > + gfp |= __GFP_ACCOUNT; > > do { > > unsigned int i; > > void *sibling = NULL; > > -- > > 2.31.1 > >