Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp1992722lfo; Sat, 28 May 2022 13:00:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWlxEcWIGVQzZ6ko5rOhfiMclowQiOeIKvLw6N8kLHO2G/YaMQdtG3kY1Bs23lPHm63mK9 X-Received: by 2002:a63:ee57:0:b0:3fa:8a91:6826 with SMTP id n23-20020a63ee57000000b003fa8a916826mr22916151pgk.93.1653768043674; Sat, 28 May 2022 13:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653768043; cv=none; d=google.com; s=arc-20160816; b=xeoK5q7oEZNyEktZxnq6Yf1ovLMzp0bhkpYKds7BDuTqvy/Cb4IZCbaD3ftj4bOjFF OyBaH7fOFghuZVYUa2zXb8LDH3sTLA22I431G49VfzAzmN6aYPOX12WzpsXAWTJCPJpv BKuIgDhHwkSgk4O1tpOlWCet/RVIkaf6rLe+lq1EJfKPSJjpMtl23E1H14S1KJVSKw00 nSP+JELwfkneCTNBkLicCMrc/7ZQP6ReU6nQklgGI1rJpz/LdJ/2vB4sD22vS+zCagdf NmpXUlYIZx/dLZEtJkOeTDFsdzuzbCHlhjtXNMv8EJrCcSM2qkU8tuV9TamolnWgE0wa tfwQ== 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=rsCeaKQYu2owUyCBDwtZbNFjRtUaibD4xCTBzD5NHwQ=; b=RGYvkaEpPxO/TbKH3BFmCGXXR9AmUAYtj0lqT45KTKbXFbc5U1W6gsrNiTaHoIlIQo bNZusijbIRB0i4EziFGs2fFfjJdnTrkqo/7vBJL0eSkYFcIjpxEZMy4CVGSURshGgPmU f7iznuJ4vW7J53qg5QAQEU29FHxH4Mx9w/B+0d8Nc73AabjzdUh/HyRhswcKKDSM0XMf zFBH8GrcpK8vOun49fzO6zcppZajBlbH8MVIQk4gikV2/n8BrBI1iqiaM2ueJFcGxS1s +nyhUrt7zKj3Pjx+mbKZEbjmhGY5aWfv7kj4SisUgnfHE5V5GdspH087mxzZUmLe/kQs Z3fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="h5Os058/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ba7-20020a170902720700b0015d49076c06si9652634plb.336.2022.05.28.13.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="h5Os058/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 55BE1DD2; Sat, 28 May 2022 12:18:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232677AbiE0Bkf (ORCPT + 99 others); Thu, 26 May 2022 21:40:35 -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-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" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 > >