Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4379838rwl; Tue, 28 Mar 2023 06:30:23 -0700 (PDT) X-Google-Smtp-Source: AKy350aUyGMiAsyqBwo7g7CjAbAu2jM/hie4MHD651eSJgdg5rDlVZKeWE9rDJsAQVNaMjVgep/6 X-Received: by 2002:a17:907:2bd5:b0:931:f9f8:d4ea with SMTP id gv21-20020a1709072bd500b00931f9f8d4eamr15486473ejc.53.1680010223120; Tue, 28 Mar 2023 06:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680010223; cv=none; d=google.com; s=arc-20160816; b=gSjEmDCjLAQXr0HA3vbVUsLpBvubEg+CZHPKs1rHb1ynsLogzP0uKWF4UIm3VkZ3C6 0N7c1Up2ZnCSeZWlaVkS4M/P9vq61g9oGFreCQbSNQmqLfcSK6SeCnIuhBvVXRLExVEp Xghghjage80WZRq85rLF6Ema8k8nTItzlFt8g+fiU2IrQdwtL3dmVr0mYyPHNAAiHtf5 m07K2HqLO4DMs9tV6xlSU4G3DbJPLNdGkxnbHnb2BVZ/xB23NNxHM6EjsVBe0G+SQuCV ZgnFBEuvO23jffnBABjzwyzdBjbHg6UwJAdsLlAlRsXv85zJf81KaD79IJPr85yJvLAG 3VJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8bJymL0yBKvMYTD1Xc/qu3GglkLI9FvB8Lv/yuqvRQc=; b=IW78365M/UGagOTTx8lYBpHGYz2S3jpZjpIxLFQGQ6JGM292Vb9jaHvP5XUDturM0o IIZe8sYqxgOI6M2oFV1eB4GKo7cfiR3LI1ivIlvtYAt8Dj3dkI6TlaAckrcXTWL3gj5G AK+qlgqDxLWuJ8zf0gh6etwHkaYasu4ILNzNal49aJs7/5RfzFwwDtwJYO77GwnwO7dT rozKJF8mqC8WWZqdDECEV1OykaYXPsyXun3+K5Ihlf5AEeqmz0l17yyO7vDTRLjlJ8zZ ETchMo+HeJTz58c29FU1lu8Xji6Ex2uE/OVYfPWCezr0QC06mm76L8O8bizU2Ota4zSC IT2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=eZy1jM+K; 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 sc16-20020a1709078a1000b009333e2401d0si33101711ejc.48.2023.03.28.06.29.57; Tue, 28 Mar 2023 06:30:23 -0700 (PDT) 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=eZy1jM+K; 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 S232127AbjC1N02 (ORCPT + 99 others); Tue, 28 Mar 2023 09:26:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjC1N01 (ORCPT ); Tue, 28 Mar 2023 09:26:27 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 184476EAC for ; Tue, 28 Mar 2023 06:26:26 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id k17so14971241ybm.11 for ; Tue, 28 Mar 2023 06:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680009985; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8bJymL0yBKvMYTD1Xc/qu3GglkLI9FvB8Lv/yuqvRQc=; b=eZy1jM+Kd53ZIzWNbOqgWbWL45Dr+Nw9ANo2PWtQbmVaWtrjCdrDAwPWv3yK9p7pwn NdX2H4aYwg5QRk1CBz5Q+PDjxvTvxqOymyHBX8fhYiwV1krbMVJo3/thEa0eeD2ncqtr 11MW+NX2xIo4RJWivNGz5B/TSrAzZmnzZLla0MAE4rR5mfGrSLcqNM08TimNues3s+u/ 7Y5UuSgD0RzJHWmkNAiahoW2q/TpdkuXvww90IJ4ZT0HDPDLUtzwosiL6k1Ay9MagttR Xll6pq0j7ma1HAlACEp1cDHFcxilfs9tVtLUSpSaT3tswN2NAz96yvtBv6Q2jzszETWW 11rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680009985; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8bJymL0yBKvMYTD1Xc/qu3GglkLI9FvB8Lv/yuqvRQc=; b=bDoZFaZZlDVzJAbhoRg8BYhS++KrT8S2j+vo+4iXuLOwQ/7lie+rkfGPj50FUytXOI h9TAn3+8vLsUY0I1QUEbCyr+yaYl/mnaZ/Eh8sqc6/8PmrYD3sCBkoyV+E2kzBogoqz+ /v7aCzFBpsDD5KpSRzO20IzSdVkv37kUkuMN3ACRcSc32jHzuT21mhqSkUSFGZzGfCB4 +mX3ZDICSSKryEX3maWYiVdAjXpE8KQkQSumHuFUegN/3YPyMN/qgd3eqzOIFy18Y3Zs R9t2qr8bLF4xQ1afHaL+9NdZKsPxmZtdKc9pPBp20nB8wjS/1SNWjKClwDHRiJRpxHg7 067g== X-Gm-Message-State: AAQBX9fVlzykIgt2gZAMDdQH5wzsNtTunWvPwt5Sv8MjkcKcv9XNo5Y5 nkottxez0iZ3GCvp9bn3LP0PWSbJJCmLJrucurax4Q== X-Received: by 2002:a25:e054:0:b0:b6b:d3f3:45af with SMTP id x81-20020a25e054000000b00b6bd3f345afmr9852686ybg.1.1680009985214; Tue, 28 Mar 2023 06:26:25 -0700 (PDT) MIME-Version: 1.0 References: <20230328061638.203420-1-yosryahmed@google.com> <20230328061638.203420-4-yosryahmed@google.com> In-Reply-To: <20230328061638.203420-4-yosryahmed@google.com> From: Shakeel Butt Date: Tue, 28 Mar 2023 06:26:14 -0700 Message-ID: Subject: Re: [PATCH v1 3/9] memcg: do not flush stats in irq context To: Yosry Ahmed Cc: Tejun Heo , Josef Bacik , Jens Axboe , Zefan Li , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Andrew Morton , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Vasily Averin , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=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,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable 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 Mon, Mar 27, 2023 at 11:16=E2=80=AFPM Yosry Ahmed wrote: > > Currently, the only context in which we can invoke an rstat flush from > irq context is through mem_cgroup_usage() on the root memcg when called > from memcg_check_events(). An rstat flush is an expensive operation that > should not be done in irq context, so do not flush stats and use the > stale stats in this case. > > Arguably, usage threshold events are not reliable on the root memcg > anyway since its usage is ill-defined. > > Suggested-by: Johannes Weiner > Suggested-by: Shakeel Butt > Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt