Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2881326rdh; Mon, 27 Nov 2023 00:51:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRX2rhr5NwrtuvPVLj7zUlcKzQAgK9G1i2YkPyJQ0cT1nTzuzJXIpo6YdaBRfhy/JswK78 X-Received: by 2002:a17:90b:4b0e:b0:285:b687:b831 with SMTP id lx14-20020a17090b4b0e00b00285b687b831mr7530798pjb.10.1701075065912; Mon, 27 Nov 2023 00:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701075065; cv=none; d=google.com; s=arc-20160816; b=wty3ynEoeIykeZ8GyFXYmxyV/nAf4sQsXnVuYrbQTYk/7VpH7TU3epwMMAsum+fBEA AUyI8DeSfacP8JAr2EdjOuA4itxfeafvj1vS1xs2D543s2PsnOoaW4PpZn8dHJTZmwb3 juiaVJWb9+iXbIW4dvRRXUeI6YIMlr18gBsj6/62LAMo/LR1G6p5uxZVr3vsnpKfnDcN OQfCubM82/mcuQbWzqj88zAyFt4x12c94smAKcoyKJRoqaMvrc19JeyerUpsIGyuGpgb VU4nGcPDPIFkUDATaPMdNbsm8ZfSF2DyyotL3sB/VEHQFBDf7p/imKRUU0Mry7PWPX+3 UEWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LRi9ngSxggQud/fxmQYL6ll8RoVr5MrBgBUE8mAhwc8=; fh=MrQvACkNPx5YN74wDuA3JHwWq0eigD5ZkbcSOmxI2o8=; b=tuXx+FRCKDvwgHeol7kZZY8wwrxsKpt+Mlr8mb6YE7IKi6OiTL9Vs9CbjvWoZFtqYv rCSeE2pAk/x8NTKK6ja+fA2IBKwuKFKl3w4hFkP5f3TUU2I2Nsk4s279FGkX38VaO2XX Yn3W9OpLbM01N7amjBSnrFgRwqB6eAnIQkSyNVHVTgN9jGIuVPDo66ljg+cEOMnkD+mj 72CTa9CuHPLgpgP4D1L2f50XcCeEgBVqnXDSkN+ZXlyzsSShUfhIQK8qSs0a6aDmLZJJ FjcmjdHJ8MpIcaiymt73t+RsX+3fj1Q5AQoETMjdZ2yjXYVgok3knEJ4OWWYL+OiJbtP prPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="bC/rzYW0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b12-20020a17090a800c00b002800b0fa4f2si9655358pjn.104.2023.11.27.00.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 00:51:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="bC/rzYW0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 38C0A805F85F; Mon, 27 Nov 2023 00:51:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232741AbjK0Iuq (ORCPT + 99 others); Mon, 27 Nov 2023 03:50:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232763AbjK0Iun (ORCPT ); Mon, 27 Nov 2023 03:50:43 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FD47188 for ; Mon, 27 Nov 2023 00:50:48 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9283D2027A; Mon, 27 Nov 2023 08:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1701075046; 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=LRi9ngSxggQud/fxmQYL6ll8RoVr5MrBgBUE8mAhwc8=; b=bC/rzYW0p69DtNQ9EhPXDxwhoOXYLaA0FIwA1DhE1yPE06UiXrAd26ZocYd/ZozXD9cDxM MYO9z66qvyp1McAmidq2m3TuEXiAOvUo+HnI68oVbm4HHA7K1ZHflxi5YMV9/xCHt1Z9cF tQ9YnC+5k2KPUEJZHIazYl8qZjuvUMU= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8958D1367B; Mon, 27 Nov 2023 08:50:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id doDqHGZYZGWVMQAAD6G6ig (envelope-from ); Mon, 27 Nov 2023 08:50:46 +0000 Date: Mon, 27 Nov 2023 09:50:46 +0100 From: Michal Hocko To: Dmytro Maluka Cc: Liu Shixin , Andrew Morton , Greg Kroah-Hartman , huang ying , Aaron Lu , Dave Hansen , Jesper Dangaard Brouer , Vlastimil Babka , Kemi Wang , Kefeng Wang , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH -next v2] mm, proc: collect percpu free pages into the free pages Message-ID: References: <20220822023311.909316-1-liushixin2@huawei.com> <20220822033354.952849-1-liushixin2@huawei.com> <20220822141207.24ff7252913a62f80ea55e90@linux-foundation.org> <6b2977fc-1e4a-f3d4-db24-7c4699e0773f@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spam-Score: 0.70 X-Spam-Level: X-Spamd-Result: default: False [0.70 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[35.72%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_TWELVE(0.00)[13]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[huawei.com,linux-foundation.org,linuxfoundation.org,gmail.com,intel.com,redhat.com,suse.cz,vger.kernel.org,kvack.org]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 27 Nov 2023 00:51:03 -0800 (PST) On Fri 24-11-23 18:54:54, Dmytro Maluka wrote: [...] > But looking at the code in __alloc_pages() and around, I see you are > right: we don't try draining other CPUs' PCP lists *before* resorting to > direct reclaim, compaction etc. > > BTW, why not? Shouldn't draining PCP lists be cheaper than pageout() in > any case? My guess would be that draining remote pcp caches is quite expensive on its own. This requires IPIs, preempting whatever is running there and wait for the all the cpus with pcp caches to be done. On the other hand reclaiming a mostly clean page cache could be much less expensive. Also consider that refilling those pcp caches is not free either (you might hit zone lock contetion and who knows what else). Last but not least also consider that many systems could be just on the edge of low/min watermark with a lot of cached data. If we drained all pcp caches whenever we reclaim this could just make the cache pointless. All that being said, I do not remember any actual numbers or research about this. -- Michal Hocko SUSE Labs