Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2953675pxb; Tue, 21 Sep 2021 11:04:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVHBHqg8nRufHzsx7E2AMJSky/TMsHkPr8agf3dOlGSKARXDSEWxUkxF8YC1oy6/BGsE1r X-Received: by 2002:a02:1d09:: with SMTP id 9mr1185222jaj.146.1632247455496; Tue, 21 Sep 2021 11:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632247455; cv=none; d=google.com; s=arc-20160816; b=W+l7SNEAwtXpVyXkpt45FDPSteVPJlD9Ow113paD7nGbEf2TF/HVAdW0snCVSS3teD 1VQDHLfzuvKjLCNQpa9RP8yBky4zC8RdBljaxehCbhKi4nM1dDrfeRdOW7CIEKI6ZMWD PxmuZQtlifNlKHOxM0rIigcaP15cPdtDPzr1rT7dQ3W13u2rEopgRwxfRkqrCEsspUoG gGrp2WfqN8HBB+MI+pHowZ7vn4ARmMn8Q2e5T6LOng8Z1quV+WslEplq0eOM5fTi+7oj gp3wXp/kBsa5alR4+5IdtRSUVr//1KvFgTZDRWshKm65NIQwF36kW7XmQjIRlREO0zQu ybiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=CYaWP1FKTUsV2gAS0XYYjwyo9Bf8DdyZWhObLWn/jw8=; b=Efvs/2SdHPXF31tDLjpIyY1R79xDCpFIl2mRUjZYgqsQSV7kxzCLRDe6kfjV5l20s5 3rVVQHT7HSTJRKTKbj0iQofHlOMbPDluygyA2dNnluB/0LQ+CgQFpf6gxSdXKyE/1mB+ Qsvd0BcjrHiN8lSLFs+k1Co+gluOo1Jo20095BYgjSc6hm4BHQYKQRqstFHqyWnEcQMq 9L20XFMgO0Z5k7N95ey5MxQ9wFPJgS9AigsTG/ugVG591oNBwNZtKxJdZdZQdHgrJ0eB jAVg/BpzLQYUiEM4xDorhxMKDt1H+XMe1CK3usC2hvCe7+phEnOrUwZgJXYwlRfw3tIn 2MJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="VRfyMRk/"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=r+9DYsUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si17100712ili.51.2021.09.21.11.04.02; Tue, 21 Sep 2021 11:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="VRfyMRk/"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=r+9DYsUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232142AbhIUSCI (ORCPT + 99 others); Tue, 21 Sep 2021 14:02:08 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:36920 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231903AbhIUSCH (ORCPT ); Tue, 21 Sep 2021 14:02:07 -0400 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-out2.suse.de (Postfix) with ESMTPS id 351871FF03; Tue, 21 Sep 2021 18:00:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1632247238; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CYaWP1FKTUsV2gAS0XYYjwyo9Bf8DdyZWhObLWn/jw8=; b=VRfyMRk/T9URM/a6Ppj0tGTnK8GE9rrePM2p/b4ekwc01Cxl5ZYYfdmklnVb8BsFiOcGCw BzfOEOnROQN2U1ii/GYZSBPKi0zdgPfBZ7Qa/prQ5qItypUADlZGUNJcO7OldpJoOp44JK QUq9USv/7zPcePH1dG6usflxWnFkQRo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1632247238; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CYaWP1FKTUsV2gAS0XYYjwyo9Bf8DdyZWhObLWn/jw8=; b=r+9DYsUmf9GR/REYQqSWduAic4zAzdLuut4eV/blR4X2P5cQPZM2N9W8CA5JSxR2EMlrnL H8VW+d9zygX/XtCA== 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 F151313BE8; Tue, 21 Sep 2021 18:00:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nqNeOsUdSmGpSAAAMHmgww (envelope-from ); Tue, 21 Sep 2021 18:00:37 +0000 Subject: Re: [PATCH 0/6] mm: Remote LRU per-cpu pagevec cache/per-cpu page list drain support To: Nicolas Saenz Julienne , akpm@linux-foundation.org, frederic@kernel.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, tglx@linutronix.de, cl@linux.com, peterz@infradead.org, juri.lelli@redhat.com, mingo@redhat.com, mtosatti@redhat.com, nilal@redhat.com, mgorman@suse.de, ppandit@redhat.com, williams@redhat.com, bigeasy@linutronix.de, anna-maria@linutronix.de, linux-rt-users@vger.kernel.org References: <20210921161323.607817-1-nsaenzju@redhat.com> From: Vlastimil Babka Message-ID: Date: Tue, 21 Sep 2021 19:59:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210921161323.607817-1-nsaenzju@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/21/21 6:13 PM, Nicolas Saenz Julienne wrote: > This series introduces an alternative locking scheme around mm/swap.c's per-cpu > LRU pagevec caches and mm/page_alloc.c's per-cpu page lists which will allow > for remote CPUs to drain them. Currently, only a local CPU is permitted to > change its per-cpu lists, and it's expected to do so, on-demand, whenever a > process demands it (by means of queueing an drain task on the local CPU). Most > systems will handle this promptly, but it'll cause problems for NOHZ_FULL CPUs > that can't take any sort of interruption without breaking their functional > guarantees (latency, bandwidth, etc...). Having a way for these processes to > remotely drain the lists themselves will make co-existing with isolated CPUs > possible, at the cost of more constraining locks. > > Fortunately for non-NOHZ_FULL users, the alternative locking scheme and remote > drain code are conditional to a static key which is disabled by default. This > guarantees minimal functional or performance regressions. The feature will only > be enabled if NOHZ_FULL's initialization process was successful. > > This work is based on a previous series by Thomas Gleixner, Anna-Maria > Gleixner, and Sebastian Andrzej Siewior[1]. These days the pcplist protection is done by local_lock, which solved the RT concerns. Probably a stupid/infeasible idea, but maybe what you want to achieve could be more generally solved at the local_lock level? That on NOHZ_FULL CPUs, local_locks could have this mode where they could synchronize with remote cpus? > [1] https://patchwork.kernel.org/project/linux-mm/patch/20190424111208.24459-3-bigeasy@linutronix.de/ > > Nicolas Saenz Julienne (6): > mm/swap: Introduce lru_cpu_needs_drain() > mm/swap: Introduce alternative per-cpu LRU cache locking > mm/swap: Allow remote LRU cache draining > mm/page_alloc: Introduce alternative per-cpu list locking > mm/page_alloc: Allow remote per-cpu page list draining > sched/isolation: Enable 'remote_pcpu_cache_access' on NOHZ_FULL > systems > > kernel/sched/isolation.c | 9 +- > mm/internal.h | 2 + > mm/page_alloc.c | 111 ++++++++++++++++----- > mm/swap.c | 202 ++++++++++++++++++++++++++++++--------- > 4 files changed, 253 insertions(+), 71 deletions(-) >