Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4446433rwo; Tue, 25 Jul 2023 06:19:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlGY6IZHkH2MFLIO1JKg+Rg2bSRYouuYoq3hqlqmgA0q6nsd6ErsX/KTXKsLKRU50Vyz69AL X-Received: by 2002:a05:6358:4188:b0:134:d27d:a338 with SMTP id w8-20020a056358418800b00134d27da338mr4633655rwc.25.1690291174848; Tue, 25 Jul 2023 06:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690291174; cv=none; d=google.com; s=arc-20160816; b=Td9Pf1UCFx6UKqh4SP+jfVG8TyF5v323yGgPn7aHqrWNdkt3l9zLKCJX7RzFFL2749 ulbVlg0ROnIcuJ/xSgF7RKuHJHTc6hs33PkXT2Jd5BU2p0XJLp9ciJGVSnuW1WNXsN3w OUWv8ntnBodoT7oZC0hfyHpSqIjOF1O16wXweZ3yX/LU2G9W94CqK9QqxrMSf1A7Hj/R L3hXys5nOt4JUDaI2c/67TsHDVKyCm0LgtyikzHbh4as1BOZUVlPwtM4sE126ExIxYYH akhZ8tpDAK5FTRoyXUHnLc1Yc/R9CS2fHDAm770z0QlFbwKOUpbNW2KD+zmf7Z6CGCh6 lplA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=Sjst0ANUHPkhmyS9EMxljg+0hKTtA2LkvoCccenEaWc=; fh=rmHglCFBwavurmmm9fA5875V9VN1WKIJkg2VqB+gtY0=; b=K2ZuES7v4sxY4apTacDXaDGG7+WKO3UMB8OVtSZJEZ31ANRncVwbb8NcAdbqL0KPIK hkPLBUV3xkCn1NGe+aizJhWDm8voN2oJfaw2GSy5MyKmPj7goW/sPQCbjLVKH5x3PpzW nnB61ayet4WwtvU7+xNRo5w7oU6eBzfFJYw7aMJKT1ABOQwR7+4yRMYhQKbHu2QNC8Cg 2a2BMyv7+7CgK0iTHhJG4Aiml/OWbR5cChB4A6To75tOgYI/ZwktJySzVfrkUZPKrmVq lBd1Km4STwfu05+z8T+tWtqLEzQ2281FdHnuNQaP/Mm3X/DoXCPaOEwYh//JvGphb5u4 pzWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="F7+xFVN/"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a63af55000000b0054ff0e193desi11434769pgo.49.2023.07.25.06.19.21; Tue, 25 Jul 2023 06:19:34 -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=@redhat.com header.s=mimecast20190719 header.b="F7+xFVN/"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233289AbjGYNGp (ORCPT + 99 others); Tue, 25 Jul 2023 09:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjGYNGn (ORCPT ); Tue, 25 Jul 2023 09:06:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07D9CE74 for ; Tue, 25 Jul 2023 06:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690290354; h=from:from:reply-to:subject:subject: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=Sjst0ANUHPkhmyS9EMxljg+0hKTtA2LkvoCccenEaWc=; b=F7+xFVN/UTPtioUDXmny4WuOauzeqiMr3GZY7z4ZN3NSNic3rnB+YM9YlvrM4oJIRcpCBR EUZkTCN/IFwszgRPwQqPwmuiuHakAykTSIQ66vIQqAu2TWbA+DLVAG6WUkHPt+sDmTvotf yFAjlzdpsTNHhc69ehl4uvxwy8/lHq0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-LwVzfykQNyWhvpEchNerPQ-1; Tue, 25 Jul 2023 09:05:52 -0400 X-MC-Unique: LwVzfykQNyWhvpEchNerPQ-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3176c4de5bbso291543f8f.0 for ; Tue, 25 Jul 2023 06:05:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690290352; x=1690895152; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Sjst0ANUHPkhmyS9EMxljg+0hKTtA2LkvoCccenEaWc=; b=dxl+vkNkyjRrxtqDKB1H/NBiWOmSmdBFWdZAhG8MbcMnrr4t5nIv4f5EhQUYQRrjaC kkBzmjfqqOE1yMJh1yNH8fEVA4R82/i9HNQvR6wX0yJWPWjbXq6DjeTG9Zsf4EMUNlRd wKKLp4g3mNIHLdNZgl86yZ+dVth/ff9U3cJrWxOZjCW9tF7X4fENjKM4rLtYL271f2mV uJx7vh30YxuqVCRNzrGfFFwPjHgWxsXLHp9laOeGBQBaJX53L2HvQma8EnbfuU6bvUkb RNJFagtgHGE3BmCwu2Kv6iRjD6oMoiOQyfmve6+qOLdSElaVBr8YhCrV0kaykcE9SGot 0Emw== X-Gm-Message-State: ABy/qLZkVJVdogjx/wc+noGZeZVDfWE6vEFTWu/jFUUKGCz6aKwscioA z6imlgCpfLHHCU9P//JFypB9wTpf78t4KDghCJBmOKBbGazcMKWUzKuloI+C8GMqNvoLz/pjI7a VYd9e2j4Hj6GhGuJcYhh6e0uO X-Received: by 2002:a05:6000:4c3:b0:314:3f98:a788 with SMTP id h3-20020a05600004c300b003143f98a788mr9662084wri.7.1690290351822; Tue, 25 Jul 2023 06:05:51 -0700 (PDT) X-Received: by 2002:a05:6000:4c3:b0:314:3f98:a788 with SMTP id h3-20020a05600004c300b003143f98a788mr9662062wri.7.1690290351507; Tue, 25 Jul 2023 06:05:51 -0700 (PDT) Received: from vschneid.remote.csb ([149.12.7.81]) by smtp.gmail.com with ESMTPSA id a15-20020adfeecf000000b00311d8c2561bsm16238717wrp.60.2023.07.25.06.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 06:05:51 -0700 (PDT) From: Valentin Schneider To: Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, x86@kernel.org, rcu@vger.kernel.org, linux-kselftest@vger.kernel.org, Nicolas Saenz Julienne , Steven Rostedt , Masami Hiramatsu , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Andy Lutomirski , Peter Zijlstra , "Paul E. McKenney" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Josh Poimboeuf , Jason Baron , Kees Cook , Sami Tolvanen , Ard Biesheuvel , Nicholas Piggin , Juerg Haefliger , Nicolas Saenz Julienne , "Kirill A. Shutemov" , Nadav Amit , Dan Carpenter , Chuang Wang , Yang Jihong , Petr Mladek , "Jason A. Donenfeld" , Song Liu , Julian Pidancet , Tom Lendacky , Dionna Glaze , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 15/20] context-tracking: Introduce work deferral infrastructure In-Reply-To: References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-16-vschneid@redhat.com> Date: Tue, 25 Jul 2023 14:05:47 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/07/23 13:22, Frederic Weisbecker wrote: > On Tue, Jul 25, 2023 at 11:10:31AM +0100, Valentin Schneider wrote: >> I have reasons! I just swept them under the rug and didn't mention them :D >> Also looking at the config dependencies again I got it wrong, but >> nevertheless that means I get to ramble about it. >> >> With NO_HZ_IDLE, we get CONTEXT_TRACKING_IDLE, so we get these >> transitions: >> >> ct_idle_enter() >> ct_kernel_exit() >> ct_state_inc_clear_work() >> >> ct_idle_exit() >> ct_kernel_enter() >> ct_work_flush() >> >> Now, if we just make CONTEXT_TRACKING_WORK depend on CONTEXT_TRACKING_IDLE >> rather than CONTEXT_TRACKING_USER, we get to leverage the IPI deferral for >> NO_HZ_IDLE kernels - in other words, we get to keep idle CPUs idle longer. >> >> It's a completely different argument than reducing interference for >> NOHZ_FULL userspace applications and I should have at the very least >> mentioned it in the cover letter, but it's the exact same backing >> mechanism. >> >> Looking at it again, I'll probably make the CONTEXT_IDLE thing a separate >> patch with a proper changelog. > > Ok should that be a seperate Kconfig? This indeed can bring power improvement > but at the cost of more overhead from the sender. A balance to be measured... Yep agreed, I'll make that an optional config.