Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2291rdg; Tue, 10 Oct 2023 02:24:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESylj7UTIKeO2Rls2WF+oAJPpzbTVl42GNGzryLWzSDKw2kewHkjJjmEQ6L6FwemDmRm48 X-Received: by 2002:a05:6808:1b0f:b0:3ad:ffa4:dfd0 with SMTP id bx15-20020a0568081b0f00b003adffa4dfd0mr25140297oib.47.1696929876058; Tue, 10 Oct 2023 02:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696929876; cv=none; d=google.com; s=arc-20160816; b=Vg9V1AiAppWq35gGN8a1WCw+k40UX5nx0ASR9+HzqOjfcivvTCf/C60c5sJ53Lg1tt y781UC/66E/JVRaK4cMnumXSkz3sDHyMBkT5d3lW15EJrbRRGn9UoyDYnLBaER43695L IVpRnBbqddWWFyPTTqT5I822Lk8/RuluCNZPJX2NHyaJQEIVoBZNT0tfqS6DlaPbrXC0 yTtpHSHlNMKdlvJU+BF80qgLLjlY1oEWom4TwWgO3WqAme8CdAigyCRrMh8iiO1k0GJx kZpEiswzsXDiOoLoGqaKe6ieM4HZB00ogUcxSvS3e5gwe09ZJKAq3E1+BXJejwUevxW9 pVrw== 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:sender:dkim-signature; bh=Xe8JpwsINq8culWJn2R97JOgXDbD5qqq96xuZqiOo+Y=; fh=vgCd2KEEgpF1RttkwZBI0tlZUk6+JVlbpQ8gPj30fSE=; b=ntUaNuUuKrvVktWrJZhuottpcBiCL6z+9IjC0DmUNYFUChWI84fDoUIOTbJkfX1ERs O3hyqYbKzmCbFRgQtOl3rSmBusTPP7NQUpgkXGPmSxNZbow8rqih0CCW0HoADNGaB42E aO/A9b1dbFfcG9kDU2H6KE6ZwQ66piaNrl3Kvjso4Pzv1c/W184FyeWk+KJ2EBaYYfjC qpK9Kj6NfaWPqn790YSfGUmGSFu4HpQJrW4RYCxePA7SCvcDrz3VuxXKPLGzglwh9GQG qqyZqFYx5r9iSsirrlFaNo2jvENfE9GjPRdn54uFUPYieJ9YuWTSJJd4dP2kHkIHJn4b Z/eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OJj0elYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id z19-20020a63e113000000b00565e87d8707si9999676pgh.496.2023.10.10.02.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:24:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OJj0elYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2CD7B8023700; Tue, 10 Oct 2023 02:24:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230121AbjJJJYJ (ORCPT + 99 others); Tue, 10 Oct 2023 05:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230401AbjJJJXv (ORCPT ); Tue, 10 Oct 2023 05:23:51 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA5FAB0 for ; Tue, 10 Oct 2023 02:23:05 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-32d569e73acso165338f8f.1 for ; Tue, 10 Oct 2023 02:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696929784; x=1697534584; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=Xe8JpwsINq8culWJn2R97JOgXDbD5qqq96xuZqiOo+Y=; b=OJj0elYmRjTJjQVKWsVJEzubr/lFuzOTu0VoqmAHISXubqDhYLCnY7ensctM2cxQmr L0UWeD9zQHOg+VKvIP41LTOMAwHzvP9Wyp7z4VREf0vL1hzwCU9wfXLNhw9Yik9G7Kua vhoR8W6ihcKAb0RHcYUQ7MkoJ5xPWK5//eAYShMcflkDuPF3oNromU10qdxupoJSDiao huUHbSUNEvTBZyFZAoUkHqt0ijqAH31T6VpEmocMqPrdDdphV1IMw3rO+1l5/STeQVuL 9AIqoXZU7vf9eoRs2Vk2Ck5zXhDHgrrCO0e3m3CtED6a6O2Bmocf2aWzPb1AcS3yjQnz mEVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696929784; x=1697534584; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xe8JpwsINq8culWJn2R97JOgXDbD5qqq96xuZqiOo+Y=; b=W+Hf1w3F9YKzLihwPPvGNZlLlIc3209ykqstqiC7bAJuCMl0mkARY8j+QnLqwf/nxb 2jHOoRB6WuFMLmAZu2yyeMkfchjtOvLXHPZhasAB7z070hf4pr0+flU9abinYl+r3NEq J96L6ugd2JaW7pg5rSHKw6AHOJxWSEmJM4WgNvO43dF/us6LVD/tbTwp0HhhvEfLO98l uLzM2GTlXcrGbAm+jiyciOSh27DDE8j0+chooY5184zlSQQKXB/dtvRNG0vBBU2LAA5m qMqmrPedFue661hempgkZLfqzpRd7wVhPuZy7RxtFaaXIupVcf9jQbsztHLULRHl9J5P qazA== X-Gm-Message-State: AOJu0Yzavw9X8EVQ46unh6PlVSzyK5zZIKPmkKKYzU98rxJOxcBL5BW9 zXAW3KjyY/JDRRgAx5JGnUc= X-Received: by 2002:adf:cf0a:0:b0:317:3f70:9dc4 with SMTP id o10-20020adfcf0a000000b003173f709dc4mr15681071wrj.31.1696929783994; Tue, 10 Oct 2023 02:23:03 -0700 (PDT) Received: from gmail.com (1F2EF237.nat.pool.telekom.hu. [31.46.242.55]) by smtp.gmail.com with ESMTPSA id n9-20020adff089000000b0031ad2f9269dsm12069341wro.40.2023.10.10.02.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:23:02 -0700 (PDT) Sender: Ingo Molnar Date: Tue, 10 Oct 2023 11:23:00 +0200 From: Ingo Molnar To: Mel Gorman Cc: Peter Zijlstra , Raghavendra K T , K Prateek Nayak , Bharata B Rao , Ingo Molnar , LKML , Linux-MM Subject: Re: [PATCH 6/6] sched/numa: Complete scanning of inactive VMAs when there is no alternative Message-ID: References: <20231010083143.19593-1-mgorman@techsingularity.net> <20231010083143.19593-7-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231010083143.19593-7-mgorman@techsingularity.net> X-Spam-Status: No, score=2.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 02:24:29 -0700 (PDT) X-Spam-Level: ** * Mel Gorman wrote: > On a 2-socket Cascade Lake test machine, the time to complete the > workload is as follows; > > 6.6.0-rc2 6.6.0-rc2 > sched-numabtrace-v1 sched-numabselective-v1 > Min elsp-NUMA01_THREADLOCAL 174.22 ( 0.00%) 117.64 ( 32.48%) > Amean elsp-NUMA01_THREADLOCAL 175.68 ( 0.00%) 123.34 * 29.79%* > Stddev elsp-NUMA01_THREADLOCAL 1.20 ( 0.00%) 4.06 (-238.20%) > CoeffVar elsp-NUMA01_THREADLOCAL 0.68 ( 0.00%) 3.29 (-381.70%) > Max elsp-NUMA01_THREADLOCAL 177.18 ( 0.00%) 128.03 ( 27.74%) > > The time to complete the workload is reduced by almost 30% > > 6.6.0-rc2 6.6.0-rc2 > sched-numabtrace-v1 sched-numabselective-v1 / > Duration User 91201.80 63506.64 > Duration System 2015.53 1819.78 > Duration Elapsed 1234.77 868.37 > > In this specific case, system CPU time was not increased but it's not > universally true. > > From vmstat, the NUMA scanning and fault activity is as follows; > > 6.6.0-rc2 6.6.0-rc2 > sched-numabtrace-v1 sched-numabselective-v1 > Ops NUMA base-page range updates 64272.00 26374386.00 > Ops NUMA PTE updates 36624.00 55538.00 > Ops NUMA PMD updates 54.00 51404.00 > Ops NUMA hint faults 15504.00 75786.00 > Ops NUMA hint local faults % 14860.00 56763.00 > Ops NUMA hint local percent 95.85 74.90 > Ops NUMA pages migrated 1629.00 6469222.00 > > Both the number of PTE updates and hint faults is dramatically > increased. While this is superficially unfortunate, it represents > ranges that were simply skipped without the patch. As a result > of the scanning and hinting faults, many more pages were also > migrated but as the time to completion is reduced, the overhead > is offset by the gain. Nice! I've applied your series to tip:sched/core with a few non-functional edits to comment/changelog formatting/clarity. Btw., was any previous analysis done on the size of the pids_active[] hash and the hash collision rate? 64 (BITS_PER_LONG) feels a bit small, especially on larger machines running threaded workloads, and the kmalloc of numab_state likely allocates a full cacheline anyway, so we could double the hash size from 8 bytes (2x1 longs) to 32 bytes (2x2 longs) with very little real cost, and still have a long field left to spare? Thanks, Ingo