Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1341021rdb; Wed, 20 Sep 2023 06:43:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+jHt9BW8Xj014da5WoCChHXTOuBg1KWlemX5fXegQ4TpfVcOn6twzmfgo5d6jo1ppQg+N X-Received: by 2002:a05:6e02:f90:b0:34f:f256:9982 with SMTP id v16-20020a056e020f9000b0034ff2569982mr2586355ilo.6.1695217391103; Wed, 20 Sep 2023 06:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695217391; cv=none; d=google.com; s=arc-20160816; b=ge1CuvcEdDVZfg9/h2YH3f3TyEIAmCrdS/htDUgkIXwcp2xBaLrbXS5SCaF0EnGAQY +ahctc1xD2Y2Io97igtFFGZEEPXDaOlhStvuufM0ibJ2SLPHD4e5uGgwEovR3idIfoXI lFM8Q/C9fgpwF06qPrXNQLlsCa7qAH/3MzeaPimoA+Ho3nKwqFVgIMeybz8P5H6W3rpw pYbULO5X6xHG6Gp2PJbJ3iGytREiDcwdEeqts7tf1hmK6WX1uOTPuv/EFHmLoBfd7DmL 4KzFwizl8rifHKDCof+NrdNT1tenQwKmJ/PdjysBGHxMKZ4gncwV0WyxM6YifO2omcuQ oEpQ== 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=b9FUmFWGdaoCCAX+yBYd9oidTjhPdRU5Hczc1k2R6GM=; fh=oxv/ZC9UVeaO2SYJq0fMIXzaY6IkGLTn0lNU3sXgHRU=; b=QKyo/XLUUEjiHDPR3alS+nGpjDRIFWqABo6VdEDnJckGaOVbI0l8iR+qv7+h6Pgltt 7m2ZgBXXTqhU88r1wQz7D+VM9OE8egBq8OMc8NPPDjr0onAcmafEaZbAmZtGc7zZoTOM /R+4YRrkGNsyIG95EgOVp8fky0UsTC2x3ZShSHl9iCCNUwcI4uRlPAH7cAwDN3oelyY5 mmkzcp9CPEoBeVXMJSfYB5LpQS0ALIttHZ1UNer2JCZDhEn2EBcRhbyPb78mftR6F1wP nkHXhj/F+xGZsAHSOoB+C5cZEOn1yXnY1vQYlabqCzgSMx6FqKDsPazTT4LLVJodAKx9 O1eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lYBYsrmh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m16-20020a63fd50000000b00578b2728aa4si3361011pgj.129.2023.09.20.06.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 06:43:11 -0700 (PDT) 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=@gmail.com header.s=20230601 header.b=lYBYsrmh; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id ABA1180B7AD9; Wed, 20 Sep 2023 00:29:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233737AbjITH3e (ORCPT + 99 others); Wed, 20 Sep 2023 03:29:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233714AbjITH3d (ORCPT ); Wed, 20 Sep 2023 03:29:33 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BFC6CA; Wed, 20 Sep 2023 00:29:27 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4051f8e1ba0so6818335e9.1; Wed, 20 Sep 2023 00:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695194965; x=1695799765; 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=b9FUmFWGdaoCCAX+yBYd9oidTjhPdRU5Hczc1k2R6GM=; b=lYBYsrmhPNW96ohxoysYDSqqE8OzwYp7oyFXge92IlJPIpKW1IObFR39gYATLEJLJX Th+IT73wJWAjUv7ZbGdbbmmq1qASbBQP4S0asJhUxSb6LdP6ON7nEZkvBiKWb27/lG7m t9cZg24pxlXfeKgxTykpJQjKV/Rl+lBB65wf3/JryRaymRpOEUYdjy8OXfNdH16HP0qX k4aJg8gca3ZgCWzqlGeSqqKa/z9MXHYn/WZpQtG3n1jr1A1xPuMsDehMohuYm8/xtbk/ o8jvN32SvCd1BN72fs5a4hTfqkZQU1bi1nW1+k+eH22Wb4Z0s2goyEQUVsfvB2WN7z+Y QzSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695194965; x=1695799765; 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=b9FUmFWGdaoCCAX+yBYd9oidTjhPdRU5Hczc1k2R6GM=; b=dMX0q9lIYcSPT0dtXJqetoLai4WuDbq0vRe9Coray2HkyIEp9ZhB6b3lVKcsuNmGJ8 g7ECBzrnAUbWiO4okQyNuivWqyMGgc+aA7pgCQs7TK81eeDg2NCn8QhqUexVn9g+wQqm 8rWdahTul9j0BauvDkf6STwZI6scW0MJgIwQhY6BVRR4kQxBv3VjrsY3bqjuQeksqb5Z +BX/lPeLrWGgo6x6S911d+D3JYPfCvgSg0TDRS8tXpFZAgN5P/ozd9Yr3czvdIDXz7o3 2EA7WqFPQQXf3f/+LJOaA052oU1g1MPUPTfuZelbRgpHrmxhwWjeqX8nKRXDPD2Lceyb tuNw== X-Gm-Message-State: AOJu0YzN1yQve/wCFuNN/Ct5eDlZBhsrPI5Dh2aiP5TpTRh3fdKT3skZ mRjD5hgPLUSPLXBnAZ9Y1jw= X-Received: by 2002:a05:600c:152:b0:404:2dbb:8943 with SMTP id w18-20020a05600c015200b004042dbb8943mr1805727wmm.2.1695194965229; Wed, 20 Sep 2023 00:29:25 -0700 (PDT) Received: from gmail.com (1F2EF265.nat.pool.telekom.hu. [31.46.242.101]) by smtp.gmail.com with ESMTPSA id t19-20020a7bc3d3000000b003fefca26c72sm1136535wmj.23.2023.09.20.00.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 00:29:24 -0700 (PDT) Sender: Ingo Molnar Date: Wed, 20 Sep 2023 09:29:21 +0200 From: Ingo Molnar To: Thomas Gleixner Cc: Linus Torvalds , John Paul Adrian Glaubitz , Peter Zijlstra , Matthew Wilcox , Ankur Arora , linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, mgorman@suse.de, rostedt@goodmis.org, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, jgross@suse.com, andrew.cooper3@citrix.com, Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org, Brian Cain , linux-hexagon@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , linux-alpha@vger.kernel.org Subject: Re: Arches that don't support PREEMPT Message-ID: References: <20230912082606.GB35261@noisy.programming.kicks-ass.net> <87cyyfxd4k.ffs@tglx> <87led2wdj0.ffs@tglx> <0e69f7df80dc5878071deb0d80938138d19de1d1.camel@physik.fu-berlin.de> <20230919134218.GA39281@noisy.programming.kicks-ass.net> <87pm2eui95.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pm2eui95.ffs@tglx> X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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]); Wed, 20 Sep 2023 00:29:34 -0700 (PDT) * Thomas Gleixner wrote: > On Tue, Sep 19 2023 at 10:25, Linus Torvalds wrote: > > On Tue, 19 Sept 2023 at 06:48, John Paul Adrian Glaubitz > > wrote: > >> > >> As Geert poined out, I'm not seeing anything particular problematic with the > >> architectures lacking CONFIG_PREEMPT at the moment. This seems to be more > >> something about organizing KConfig files. > > > > It can definitely be problematic. > > > > Not the Kconfig file part, and not the preempt count part itself. > > > > But the fact that it has never been used and tested means that there > > might be tons of "this architecture code knows it's not preemptible, > > because this architecture doesn't support preemption". > > > > So you may have basic architecture code that simply doesn't have the > > "preempt_disable()/enable()" pairs that it needs. > > > > PeterZ mentioned the generic entry code, which does this for the entry > > path. But it actually goes much deeper: just do a > > > > git grep preempt_disable arch/x86/kernel > > > > and then do the same for some other architectures. > > > > Looking at alpha, for example, there *are* hits for it, so at least > > some of the code there clearly *tries* to do it. But does it cover all > > the required parts? If it's never been tested, I'd be surprised if > > it's all just ready to go. > > > > I do think we'd need to basically continue to support ARCH_NO_PREEMPT > > - and such architectures migth end up with the worst-cast latencies of > > only scheduling at return to user space. > > The only thing these architectures should gain is the preempt counter > itself, [...] And if any of these machines are still used, there's the small benefit of preempt_count increasing debuggability of scheduling in supposedly preempt-off sections that were ignored silently previously, as most of these architectures do not even enable CONFIG_DEBUG_ATOMIC_SLEEP=y in their defconfigs: $ for ARCH in alpha hexagon m68k um; do git grep DEBUG_ATOMIC_SLEEP arch/$ARCH; done $ Plus the efficiency of CONFIG_DEBUG_ATOMIC_SLEEP=y is much reduced on non-PREEMPT kernels to begin with: it will basically only detect scheduling in hardirqs-off critical sections. So IMHO there's a distinct debuggability & robustness plus in enabling the preemption count on all architectures, even if they don't or cannot use the rescheduling points. > [...] but yes the extra preemption points are not mandatory to have, i.e. > we simply do not enable them for the nostalgia club. > > The removal of cond_resched() might cause latencies, but then I doubt > that these museus pieces are used for real work :) I'm not sure we should initially remove *explicit* legacy cond_resched() points, except from high-freq paths where they hurt - and of course remove them from might_sleep(). Thanks, Ingo