Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp199938imw; Mon, 4 Jul 2022 07:40:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sNxmnRecMIC55V3/LP8w4RpO7zVmoml4xn5xMeHa2uxai27VIp4yS+Lzia3GfC6kx/RPqR X-Received: by 2002:a17:907:3e08:b0:726:2af1:1d5f with SMTP id hp8-20020a1709073e0800b007262af11d5fmr29835223ejc.235.1656945649920; Mon, 04 Jul 2022 07:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656945649; cv=none; d=google.com; s=arc-20160816; b=mZjj2Iy5NEwyl6y2Sxc8s+WDk0iAqirs0+5ro7V0XiJFlmF3nQNXNqxuRvb1XAJhZ0 nMDlBnVifgMb5RO+8g0LB0234DZUdIMgzk3JUa6soG3B6TWGyykYByZbJsC/Am5d6LlP 4KgsbpTE8o2tXt1ihXKfnZOXbECP1QHTzm+sM9pUTUTwW+GCz+ybTXy3oxnk9l38McCf Pcy8jBSf7s5Y/+GA+k/kI0V2koOc3xWatw+wKBSVLDXNS9XnwfQ9FSPnQQCnll0NjC+H StCpd8mPjhu3DwwSyBD1K9KfraE++0vdGyhxO/qA9da1Odao8E/10uDx/WFH0jCsZnBw /enA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=BR/SioYK/3UlUv+psIKKpEvMM12Z72hpn/Bf8OVfu1A=; b=lYIOAF0haQ0a9FlLPUnjESlNoigtKmWZ9hyfkt/pNlHtjPY7fYWXPGEjpXhwQl+bgj iOS3TF8j1PxfTwRvcC/CTx1bs1m/jICP5TYn9ypRIsDTjtgp5eXoBepn5jGyiWJZakzq xr+6CDFN+FyE0xfiKe7E83Cd6KY0yUbilm+id6880F35HLr74XAf1698YxysQptgNY7u E1MfKUmLEAf6NBJKrKLkla07hlb6fxcR6wiTbnpKVwsPo1oN16JeZLf+/QOqF3LXgczj tUy8OhWMbM0ovTNc5hU1E3ERJe7oxmKCe1ZNP2j0PyIseKbo4MGlK5BRSdlG3TYKepSV v16w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lZmJ++Fu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d29-20020a056402401d00b0043a12be8863si7021607eda.302.2022.07.04.07.40.25; Mon, 04 Jul 2022 07:40:49 -0700 (PDT) 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.cz header.s=susede2_rsa header.b=lZmJ++Fu; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234508AbiGDO24 (ORCPT + 99 others); Mon, 4 Jul 2022 10:28:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234428AbiGDO2x (ORCPT ); Mon, 4 Jul 2022 10:28:53 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9704BE49 for ; Mon, 4 Jul 2022 07:28:52 -0700 (PDT) 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 544F822602; Mon, 4 Jul 2022 14:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1656944931; 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=BR/SioYK/3UlUv+psIKKpEvMM12Z72hpn/Bf8OVfu1A=; b=lZmJ++FuDv4OX+l34Cct/u+0+0eLoK3yxRaV75+WwNF0nIXQu7SOQS5hwugeqm3NVySo0J xgpcYirdOpNFBQ+n1IpnGRqSAlfhZaGZIO0zXi3hZLPRVBxk91gTsXkvWRHhSRxRu39sUK 6jgFg4QuDajaJTpjWgyopYY8NshpvPo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1656944931; 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=BR/SioYK/3UlUv+psIKKpEvMM12Z72hpn/Bf8OVfu1A=; b=rx1l78EaJzQbrKD5XpVcvRoDJo+4yg6br433Ny9OR5xV1RNs5WPw3R39DNsMpH8fbHWyi7 HKD6ea8MC4m8JDCw== 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 28CE313451; Mon, 4 Jul 2022 14:28:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zhsbCSP5wmLbXwAAMHmgww (envelope-from ); Mon, 04 Jul 2022 14:28:51 +0000 Message-ID: <2f9a95b8-d883-d5a3-3714-801bae36eec2@suse.cz> Date: Mon, 4 Jul 2022 16:28:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 6/7] mm/page_alloc: Remotely drain per-cpu lists Content-Language: en-US To: Mel Gorman , Andrew Morton Cc: Nicolas Saenz Julienne , Marcelo Tosatti , Michal Hocko , Hugh Dickins , Yu Zhao , Marek Szyprowski , LKML , Linux-MM References: <20220624125423.6126-1-mgorman@techsingularity.net> <20220624125423.6126-7-mgorman@techsingularity.net> From: Vlastimil Babka In-Reply-To: <20220624125423.6126-7-mgorman@techsingularity.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 6/24/22 14:54, Mel Gorman wrote: > From: Nicolas Saenz Julienne > > Some setups, notably NOHZ_FULL CPUs, are too busy to handle the per-cpu > drain work queued by __drain_all_pages(). So introduce a new mechanism to > remotely drain the per-cpu lists. It is made possible by remotely locking > 'struct per_cpu_pages' new per-cpu spinlocks. A benefit of this new > scheme is that drain operations are now migration safe. > > There was no observed performance degradation vs. the previous scheme. > Both netperf and hackbench were run in parallel to triggering the > __drain_all_pages(NULL, true) code path around ~100 times per second. The > new scheme performs a bit better (~5%), although the important point here > is there are no performance regressions vs. the previous mechanism. > Per-cpu lists draining happens only in slow paths. > > Minchan Kim tested an earlier version and reported; > > My workload is not NOHZ CPUs but run apps under heavy memory > pressure so they goes to direct reclaim and be stuck on > drain_all_pages until work on workqueue run. > > unit: nanosecond > max(dur) avg(dur) count(dur) > 166713013 487511.77786438033 1283 > > From traces, system encountered the drain_all_pages 1283 times and > worst case was 166ms and avg was 487us. > > The other problem was alloc_contig_range in CMA. The PCP draining > takes several hundred millisecond sometimes though there is no > memory pressure or a few of pages to be migrated out but CPU were > fully booked. > > Your patch perfectly removed those wasted time. > > Signed-off-by: Nicolas Saenz Julienne > Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka