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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13E16C636D7 for ; Tue, 21 Feb 2023 15:21:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89F606B0071; Tue, 21 Feb 2023 10:21:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 84ED66B0072; Tue, 21 Feb 2023 10:21:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7157D6B0078; Tue, 21 Feb 2023 10:21:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 61A4E6B0071 for ; Tue, 21 Feb 2023 10:21:21 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 43D68AAAAE for ; Tue, 21 Feb 2023 15:21:21 +0000 (UTC) X-FDA: 80491662762.17.31FDCCA Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf14.hostedemail.com (Postfix) with ESMTP id 5DCBF100006 for ; Tue, 21 Feb 2023 15:21:19 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=LgKqeo2y; spf=pass (imf14.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676992879; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gzHiHoqH1FZ2e8or4vCjWdlBkU2/7QX1hNdRkugFVaM=; b=WkOkM20hrHpEbyx9gsc0ZX7/OMHHHmE+QIaH+O0Qnl1P2jMmQcgdLZVrEvziM20LGqulND +ERg9iT3+8dylrL+0DpCKbN27X7CNskSfYovtnhyXv9Ru7c4c8lsyguW15jyQ+fMhsR453 fLhFMThZI5W0bKiu35vAYyDgMAuby3U= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=LgKqeo2y; spf=pass (imf14.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676992879; a=rsa-sha256; cv=none; b=b8uZGsBMH53+pQaiyUnwhjJUzQyr3V8TLzVrCMt81fr1/rcT5/n6Rnkrimw/VtCDkzLxyZ rkcI74XgwbIBLh/Ou9FJIpBgbC2OVX5/lVpJpi0w+AOFa7W+C2pDS2JUI6bP4MV4rjk8Op oxnVeUuTauiDA7KV2MEVHffHzr8MCj8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EDEB234C14; Tue, 21 Feb 2023 15:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1676992877; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gzHiHoqH1FZ2e8or4vCjWdlBkU2/7QX1hNdRkugFVaM=; b=LgKqeo2yQ2b1D0vJPE7Wjp9MTcodIdE2vXEn1gZ//a8FuhQ9ii4mh4H5rDAL/Tr1f9SzFB sB8OPFP2fFPTN1KhtaaEvkMNx1gadQSAqlS9PRt1QrX4dncGI7ulO5iOTfM1uRSUZvsKU7 12M7ip+L/P6NrUrHbV8prJjVsYRv7Kk= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CD84313481; Tue, 21 Feb 2023 15:21:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id o626L23h9GP7bwAAMHmgww (envelope-from ); Tue, 21 Feb 2023 15:21:17 +0000 Date: Tue, 21 Feb 2023 16:21:17 +0100 From: Michal Hocko To: Haifeng Xu Cc: hannes@cmpxchg.org, shakeelb@google.com, muchun.song@linux.dev, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/memcg: Skip high limit check in root memcg Message-ID: References: <20230210094550.5125-1-haifeng.xu@shopee.com> <82918a12-d83e-10c0-0e04-eec26657b699@shopee.com> <99bdfbec-2de4-b432-9649-09557d3f95d6@shopee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99bdfbec-2de4-b432-9649-09557d3f95d6@shopee.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5DCBF100006 X-Stat-Signature: 9mhjke5bao6pf5b4njed3moh1erftkzh X-Rspam-User: X-HE-Tag: 1676992879-166022 X-HE-Meta: U2FsdGVkX1/OiaVJkKphw0zrWBl6gptPL3dSrWzBUMbLUbsPqV0y0dGTs503uv4vhQR+2avQv0vo2p3OGVgsVNfLNrbC/LRn13Poru0pMCcBeQ+dVnxe0ExHkV9449UbFm4SuZ1QglAXwVVKFnVkehcTuig4vO2rsNNnkRsK9cp2QtCtPXd4kLqKLEGve1oTwYassJxW/bAtLZJrsVyTE+TS0L0L9yQk87lAJbllgYOpAiVvplRH28RGuJ5ln/86KrAnoqLqVJ223e0HudcwT1ikksX3hX9lOUUovIrbgx3WsXJ6UNQe+Odtk2bPS3zfc3ckjGT822Mn/KmJjAeki3STtMZCQzeqzeSdjBtlr1V9dOAdInc5k7DRnCNC97FnQoEXgMlU3mJPxL7bsqm1YBu8DyFpYsXx1kEuzEDFA3BAcYKsCHi3jbs055G9sinMd6jz40x29T94vqeEmhJZA37UT3ATm4CLYe5+AcU66ii2gtfnxNofQC1vru7Yzd6LdmB4IyRJ/pUmzgs5L4JwJcc8dIGTZ7u4YcK6rqLBUJKO9i/pzKNjqJE13AEnzJuwt1hpB/nhiepeomzIdfCUm9vwsETIX0INgcajPtih3dpvcUI4iVOIF3PSh1Blri64JnU5R5vHBTUiTvjR7woNCdc86vb68qG5sYMAHdgAfo/fA2g/I2uzr61rK3Ts2P1Cp8NS44ISZm55jEo/waRRa998uRk5/R0TtWlQ5ureaSEga/h2kIlh2WOVJGTbysMXKrnBE5sHbcdAd64lupzlSLwbo9+Dot4asUH877AJeM0yIrgiw6j5ng9mDH+/S6/XM47LK5Ct2TLUXyfgw3x2deENO4NJl1rMSq1lgY5L+7beFseJpgbQJ3xdtAaFbvL7veyvw4c5axPTg4lZz2dPzji8hj9Dz8xfPZNqS7cB5tzyC/2le5Oo+NbC18UA8MiXL57Z7qyWpWhz0KkYGfE ylBj3i/8 NHBqIQw8Zn7Rkobe1uw3bNQwNuUgafeRwx4qCB4rU/dPaeWI5WmWLBHcwRNYNOIrMQ+Ih3fPs80h8OEOeO9oKiah+FJ+H1wLVHQh+RiPXUagGFb2KdzGPoAS9uEDj9onQMmPZYOhmmiuitjkHlo4ETEtR5JPRIkMZ6I/c X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 21-02-23 22:21:45, Haifeng Xu wrote: [...] > >> The test result show that with or without the patch, the time taken is almost the same. > > > > This is in line with my expectation. So the question is whether the > > additional check is really worth it. > > This patch doesn't bring any obvious benifit or harm, but the high > limit check in root memcg seems a little weird. Maybe we can add this > check Well, I do not see the code to look weird TBH. There is nothing wrong in doing the check for the root memcg. It is a bit pointless but it is not incorrect. > It all depends on your viewpoint. >From my POV, I prefer changes that either fix something (correctness issue or a performance issue/improvement) or improve readbility. The check doesn't fix anything and I am not convinced about an improved readabilit either. Thanks for the patch anyway! -- Michal Hocko SUSE Labs