Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3878682pxb; Fri, 11 Feb 2022 09:41:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWigwmxYoX4DJwR5z0a3cz1IDT2f697/XB7PB2YeGHa2VUQ7Gjz26j5CR6h8+ILZWkyGbx X-Received: by 2002:a17:902:bb90:: with SMTP id m16mr2608775pls.2.1644601317043; Fri, 11 Feb 2022 09:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644601317; cv=none; d=google.com; s=arc-20160816; b=ZcOa/UZ8UTS/BIBoZCr5F0t7JubeepnOcxhXOIcT8xZO7qQJ6RMa1FU7hOanPS7wBz pqf0QVaGYackNwH9zGQOLcw6uForjlwtyJdxUopHmZNvOvMHl0TwaPIHDl3rVsgSagAr NFgA4taiSSq96+yNBJg75sC1sFQRoUoIkk2mBCv8d+2W2I323Xwca+rW/eZm6r4o7KkG kGfVcI6qUE45aA/rwllSTOOhMFtG9ukUYu9pYEXL+Bt6t8v2yLwHxj/ALh7DSFonfqm9 eiXXiFsUC9SlN6E2UJKj4/9GeNe/NsfmMd4pAT9Vz64kPulDZXvMRW8Gfp59pe2erHm3 JYwQ== 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=+9taNQqr53065W1oX4JDNtAk/+njpm3x8DzxRxP1lHU=; b=snqFsi0cD6eeGhSPf/5CU+cUiYJQOMPvETGcsDyh/Zmjg2fnjs91ySHjpc7vqUcX9V fu7ZQ64s3nOP4jaeeiRHDLDjJ9e6CWZLlVetEY6MRH9bzUH5K1vZ09Z58G4LGguX0+RU gpVFecDTZlkqzbWR6JdoBp+VPeoEcxkTo2eXvADwMKTM9GP3VKKnJHq/6a6X1i9dwa9I HCfKaASlxn9+5bKkb81eWpAXtO+zncGSiJFzVUdeW/bFfWDfExBvauzNUt1AQ47KH8Qt FnPv7owdT7VsYy266SDPqVFHEh6eOIGay02pcjc4A4CVp3guR//0/jp1zbvfilouuVGh setQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=D959OvVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1si13168528pgc.1.2022.02.11.09.41.41; Fri, 11 Feb 2022 09:41:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=D959OvVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242249AbiBJWZV (ORCPT + 99 others); Thu, 10 Feb 2022 17:25:21 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbiBJWZO (ORCPT ); Thu, 10 Feb 2022 17:25:14 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2700218E for ; Thu, 10 Feb 2022 14:25:14 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id u6so13090146lfc.3 for ; Thu, 10 Feb 2022 14:25:14 -0800 (PST) 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=+9taNQqr53065W1oX4JDNtAk/+njpm3x8DzxRxP1lHU=; b=D959OvVwl7BXuwDxGu0YH5B8iaG9JycwJXSActYL0Rhkvl1XpSclE6R6SP/TS9KpOb uIITo6yOM2u/NW7Lpt2qvugxdahKXm7DxUSfw4CvZOax6yiLj0PuPiJD0kxUvrCoLRZE 8+tEADL2hNCtlzAphVfr0GXuxsruicxdkryZKu4A3EZQYGNy1YGT2PXBJWQ7cmvCU5sT JmTq6TyMVzqerdn7CZcyv983bkS+4BRuAEOfAWl2vQTFGVVjXWYx7YXbhJ8zrn9tghSq n6Z4aZpGnza7LI6CgiHjzXoxAuxZQeb8ZX3fWnC9sHKXTbS9MAdJvXlr3WYwA+ZhdPb1 7tbA== 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=+9taNQqr53065W1oX4JDNtAk/+njpm3x8DzxRxP1lHU=; b=28aSS8GZgFKh3Y4vEgWwQJ2xUB9c4QGaCBvNa6jg9G46HCvzooPqLNZtb4qV7VwWn3 1FjOvNPfwKNVuC1uVPkWaFWuCRaj/nuJE7jQFe49HUDC59xSi+uNyrxkCG0eNBZodiAR OWFqhBlUVGn9ODakVyFlOsf0+9ACeB974rohzLdKgzO3wDIeYWRplIUDyuxh1tgo0zGc 7Oi5KkqU9yVp90AB8uj0RFifQeXkG1nUdyR/vLe662BMLJ/flRc/eVXIfyhM/NK219bH tv9DQdBRYT4AM5VJzIBQ43P2KFbNaQdDertURdgOw5S8ZZ8hQdUcQhpDNiK1iN/i3SpF Q5tQ== X-Gm-Message-State: AOAM533UkwiiTLw+Y7IQbp/Iwtf5bsR04OO/CRGHn1izZdSRiWDukV6P Evl2oDa7HZ+pA1b3ae2jcycx0w5vV4LbYvr8i8AEww== X-Received: by 2002:ac2:43ad:: with SMTP id t13mr6592317lfl.8.1644531912995; Thu, 10 Feb 2022 14:25:12 -0800 (PST) MIME-Version: 1.0 References: <20220210081437.1884008-1-shakeelb@google.com> <20220210081437.1884008-3-shakeelb@google.com> In-Reply-To: From: Shakeel Butt Date: Thu, 10 Feb 2022 14:25:01 -0800 Message-ID: Subject: Re: [PATCH 2/4] memcg: unify force charging conditions To: Roman Gushchin Cc: Johannes Weiner , Michal Hocko , Chris Down , Andrew Morton , Cgroups , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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, Feb 10, 2022 at 12:03 PM Roman Gushchin wrote: > > On Thu, Feb 10, 2022 at 12:14:35AM -0800, Shakeel Butt wrote: > > Currently the kernel force charges the allocations which have __GFP_HIGH > > flag without triggering the memory reclaim. __GFP_HIGH indicates that > > the caller is high priority and since commit 869712fd3de5 ("mm: > > memcontrol: fix network errors from failing __GFP_ATOMIC charges") the > > kernel let such allocations do force charging. Please note that > > __GFP_ATOMIC has been replaced by __GFP_HIGH. > > > > __GFP_HIGH does not tell if the caller can block or can trigger reclaim. > > There are separate checks to determine that. So, there is no need to > > skip reclaim for __GFP_HIGH allocations. So, handle __GFP_HIGH together > > with __GFP_NOFAIL which also does force charging. > > This sounds very reasonable. But shouldn't we check if __GFP_DIRECT_RECLAIM > is set and bail out otherwise? > We already have a gfpflags_allow_blocking() check which checks for __GFP_DIRECT_RECLAIM.