Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1920011rwb; Fri, 11 Nov 2022 02:19:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf4H1YPcSzM137ctgvrc5fW3OQzgFVmtEZ2VTfUXT3P+bLzjl5sa4ax7tFr5R2GaudWvzuTw X-Received: by 2002:a17:906:6d45:b0:7ad:fa6c:5e69 with SMTP id a5-20020a1709066d4500b007adfa6c5e69mr1298407ejt.199.1668161991475; Fri, 11 Nov 2022 02:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668161991; cv=none; d=google.com; s=arc-20160816; b=h/idNTRIhDol42/7DDUGX21ADhQalHpD3wVUq+JtNQ+k5Bl1FRLw3MyItfj/XDJpK7 bAK4r1JXZtxLlo7cLDI+rrhgRSeafEgdl926uHpvPms5u7na4B32WUPg3Bt4QBxfK8SW xbNzBnbLsjaj3yrq71J9DaTc0fW1ik4vOLBkbMYnPGIFMU+XmYVUKTMx/mu9L+3NkvY6 gqVz3+Wi3DRe4UIpQYR5geR/EnV+zZVp4DbWyZWi0XDv0LAHODlSuK8YLF/tDbH4w2GT 3HeZ4Ak/uTFifG/hiOTOKDk6i64T0VoCkaZd4MVokY5pBjXNU2ool8PlGHr+qvNwfeNT kdjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Njy+9VQDA2x8k6xdte7NdH5PI4Y0RD6JCuHPbQ59y9Y=; b=Fsrt/DdOnqPCKCwzwvfd+B8FeXQ1I4WtPsWhVayqLKFdO4rdXPIkr4CnbTo11j9GNC o3SDDpNcKEBtcuqm4Ir1Ng10A9lvwpQJVA4eLht/FjaTkWKC9rwBdZLaXB63kmn8b/vd F2ndhiRFeJzZ0hurNqiCxBNM+BbBYWlI3PSt7hLIusFCYLSmgfIMcTx1Jx8ZlTE6GZaF NWeb/eHOjAZV8fZhlGqC16PQ/xahChOK65tx0tbBTO6Q/JwWJm/bNct0hzGqzA57AflO od26Itl9xln+AMg7WTPmsoJyBPcjY6OYAvKjkEjNZDLIPgbUr1cgzlRTwDpHmELz8yIg Mn9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mij2Vx3p; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b61-20020a509f43000000b0045a1e2373dbsi1840660edf.44.2022.11.11.02.19.28; Fri, 11 Nov 2022 02:19:51 -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=@suse.com header.s=susede1 header.b=mij2Vx3p; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233338AbiKKKIt (ORCPT + 92 others); Fri, 11 Nov 2022 05:08:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232177AbiKKKIs (ORCPT ); Fri, 11 Nov 2022 05:08:48 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E67DF038; Fri, 11 Nov 2022 02:08:47 -0800 (PST) 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) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 --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--