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 33637C433FE for ; Fri, 11 Nov 2022 10:08:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 594016B0071; Fri, 11 Nov 2022 05:08:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 51D436B0072; Fri, 11 Nov 2022 05:08:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3BE856B0074; Fri, 11 Nov 2022 05:08:48 -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 2E98C6B0071 for ; Fri, 11 Nov 2022 05:08:48 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E68B64021A for ; Fri, 11 Nov 2022 10:08:47 +0000 (UTC) X-FDA: 80120737494.01.61E067F Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf06.hostedemail.com (Postfix) with ESMTP id 520D1180009 for ; Fri, 11 Nov 2022 10:08:47 +0000 (UTC) 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 BD43B22A6B; Fri, 11 Nov 2022 10:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1668161325; 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=Njy+9VQDA2x8k6xdte7NdH5PI4Y0RD6JCuHPbQ59y9Y=; b=mij2Vx3pVUYxoFhx5V9lxpwv4DvmeN9TvBH9YYtc49WknJbIUyktZGk10aPTQ00zdKLPWO oRNWMZr/dcvxJ9hSlakB50Gl5mCTfCJ9KpdDzJshteaGX5hubk+5tcRdYPupAw3AilLiXV oqBZSAgliR2auCbW9y5N0bPQIGDv7fg= 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 7B5CE13357; Fri, 11 Nov 2022 10:08:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oS7oHC0fbmNGeAAAMHmgww (envelope-from ); Fri, 11 Nov 2022 10:08:45 +0000 Date: Fri, 11 Nov 2022 11:08:44 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Yosry Ahmed Cc: Lu Jialin , Johannes Weiner , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm/memcontrol.c: drains percpu charge caches in memory.reclaim Message-ID: <20221111100843.GG20455@blackbody.suse.cz> References: <20221110065316.67204-1-lujialin4@huawei.com> <20221110144243.GA10562@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q6STzHxy03qt/hK9" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668161327; a=rsa-sha256; cv=none; b=GAa3J8ccUAV/TMDTLvVui/1E/SQ4RBmP+S8xxAwikeZlgcENa2edELPLM0GcDoE3qY+Reg lRMO7JNV1zsQ3l7wy3BLQdeLwWGYeh5QE0E3isK2w3afVY6wKifOytmKFPo0367S21dOc3 b6APUVuJhhIjSaS03T7SF0A7vSU+huY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=mij2Vx3p; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf06.hostedemail.com: domain of mkoutny@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mkoutny@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668161327; 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=Njy+9VQDA2x8k6xdte7NdH5PI4Y0RD6JCuHPbQ59y9Y=; b=CFM+tuT8+HKbYOKqfrSYCvXfeMxv5Ba2CagQzN5R7jZpPHURHzhoAfgj/Ut1/lgjgMMLIC T3A90OYajsaHqqFMpKfTCHZ8ZM7/gPBv0vgdFxpsjh2FdVYneDPZuIZgcu1wlI2QOd3y/q RBVJ4VJ5h79hl+4Z0sRJ2GzMQHko7rA= X-Rspamd-Queue-Id: 520D1180009 X-Rspam-User: Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=mij2Vx3p; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf06.hostedemail.com: domain of mkoutny@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mkoutny@suse.com X-Rspamd-Server: rspam06 X-Stat-Signature: y7z8bugqpkk9op9fs3ghgtr9kyy9bfxh X-HE-Tag: 1668161327-627562 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: --Q6STzHxy03qt/hK9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 10, 2022 at 11:35:34AM -0800, Yosry Ahmed wrote: > OTOH, it will reduce the page counters, so if userspace is relying on > memory.current to gauge how much reclaim they want to do, it will make > it "appear" like the usage dropped. Assuming memory.current is used to drive the proactive reclaim, then this patch makes some sense (and is slightly better than draining upon every memory.current read(2)). I just think the commit message should explain the real mechanics of this. > The difference in perceived usage coming from draining the stock IIUC > has an upper bound of 63 * PAGE_SIZE (< 256 KB with 4KB pages), I > wonder if this is really significant anyway. times nr_cpus (if memcg had stocks all over the place). Michal --Q6STzHxy03qt/hK9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTrXXag4J0QvXXBmkMkDQmsBEOquQUCY24fFAAKCRAkDQmsBEOq uQqYAP43Vb8o2c74sobuMNtlWw1gCKYZQ/J7GQSxdpVrnAcQdgEAwVkZvEqxNW26 8VIva1cppj+dAzB+o1VI3+WkrJk8uw8= =Z1CV -----END PGP SIGNATURE----- --Q6STzHxy03qt/hK9--