Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp391955rdb; Mon, 18 Sep 2023 20:22:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEk914bGpjygJ05VXyGONq0J0GDIgQVIRXFhs8FEkhPTQSw4oLw9O6QuYZzXxwUma/vP99S X-Received: by 2002:a05:6871:2081:b0:1d6:6430:f743 with SMTP id ry1-20020a056871208100b001d66430f743mr8723389oab.19.1695093730107; Mon, 18 Sep 2023 20:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695093730; cv=none; d=google.com; s=arc-20160816; b=QKftzfO3q4l8I042oR7frssEiizK+PkNPBu13heqkLyhrztwbZa0O6DQnJzpgEJyWI xJ/vr2MQgkVcUCV9QdhL2hPmzgTL9JuHKHvHV+FHObhxLFwDAPClpYfC0GhYjJUVnL9h KTm3QPOd5IakG/X1agDYoHsVxRr0l9ijFXUTH7io1pNcMp8wwRqFpX+ciIQp5CZjO1c0 YdJvhFOTzJP9FrQWJKwhn5xskJ9H/6P2owafzAkC2fHwamYc9U+czfjxwvZQoOvBjkxq WxdopfPD2ZWI0VnCOGxgZthfYGzdGvMPgvTVn7+Rs3nUfOzjTtndN2IsG6d9zHsF3yaw zsQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature; bh=kxF9TcI60H0dqMRajNtQ3h1ZaVkRNMZhyZPCtXkyEyc=; fh=yw+2WQ/DQQ+fbHEeaqjDc4QA0qZFp2OJrhFPr9KsXd0=; b=fQrGONemds2ZqPXLuwu3Cw51rmplHlMTYPkPKkUURzEBODmJS+haE+dD/PqQ6r72mD VjRh5L604yjV9cWW0CNHl78lCAK4XZLrKwzurXukGRdQa4JJVlltVzgsKlKmZxIy5pZK 8r0gDbpExr/3nSKbK9rxB6wD/KxtMEkyGwePx3q+80wG8/IVw9jtxV1ERaxdtmEVNwwJ iYrmfgECg1NYrJvmrky3DW/T0hCc+SvWDUMZ2giETuN/+WbNR5N2vjcFK5DjpOoGHA/+ 64jYT6LxI07DkufAxwgsmP90OoBp0PQ9BbozI9FALEWs60VmTbjrkq2GSlPvzlnY9HPe pwrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T9UqLjel; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m137-20020a633f8f000000b0055b43079642si458338pga.120.2023.09.18.20.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 20:22:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T9UqLjel; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 04CB880A58D0; Mon, 18 Sep 2023 20:21:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231256AbjISDVl (ORCPT + 99 others); Mon, 18 Sep 2023 23:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjISDVk (ORCPT ); Mon, 18 Sep 2023 23:21:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F15F095 for ; Mon, 18 Sep 2023 20:21:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E26EEC433CA; Tue, 19 Sep 2023 03:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695093694; bh=2LmdUZ93iSSVlvHPq9dbFfq6CmmQx0dj2FhDOilY2EE=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=T9UqLjel250GdB/Fn2eQngGfDU+//WxgXbilQglPIIbh3xV0GsuoisDdzUJ3ox0vN NEb17M//LANRGDt8rLOk5vPOQFLN+WVhr7fPx0707AeU1S4zANOEulyC8nqgyjwUDd EUju5t+k5bmhOWx/ty2qF47/xxbPnWjwDTsLLGAtKdrl9mvv1AOxBUb42LYubuKyLS XA75B6FgrO6+hriGxOoBGm52bi9wROUdC0WkQv3Z4U9V1XQgfP70mqKV9iYfEL9jXP 4EpL/POP4nyGe33INfVceyZ75dTGfNoPZ1lY6ux6xLnutnAH3iP10+yd5NaEIATvKh K2IaDfz0LRrQQ== Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id BC0BA27C005B; Mon, 18 Sep 2023 23:21:32 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute3.internal (MEProxy); Mon, 18 Sep 2023 23:21:32 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejledgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehn ugihucfnuhhtohhmihhrshhkihdfuceolhhuthhosehkvghrnhgvlhdrohhrgheqnecugg ftrfgrthhtvghrnhepvdfhuedvtdfhudffhfekkefftefghfeltdelgeffteehueegjeff udehgfetiefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnugihodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeiudek heeifedvqddvieefudeiiedtkedqlhhuthhopeepkhgvrhhnvghlrdhorhhgsehlihhnuh igrdhluhhtohdruhhs X-ME-Proxy: Feedback-ID: ieff94742:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 35DA131A0064; Mon, 18 Sep 2023 23:21:31 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-761-gece9e40c48-fm-20230913.001-gece9e40c MIME-Version: 1.0 Message-Id: <39998df7-8882-43ae-8c7e-936c24eb4041@app.fastmail.com> In-Reply-To: <20230830184958.2333078-8-ankur.a.arora@oracle.com> References: <20230830184958.2333078-1-ankur.a.arora@oracle.com> <20230830184958.2333078-8-ankur.a.arora@oracle.com> Date: Mon, 18 Sep 2023 20:21:11 -0700 From: "Andy Lutomirski" To: "Ankur Arora" , "Linux Kernel Mailing List" , linux-mm@kvack.org, "the arch/x86 maintainers" Cc: "Andrew Morton" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Ingo Molnar" , juri.lelli@redhat.com, vincent.guittot@linaro.org, "Matthew Wilcox (Oracle)" , mgorman@suse.de, "Peter Zijlstra (Intel)" , "Steven Rostedt" , "Thomas Gleixner" , "Jon Grimm" , "Bharata B Rao" , raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, "Linus Torvalds" Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED Content-Type: text/plain X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 20:21:43 -0700 (PDT) On Wed, Aug 30, 2023, at 11:49 AM, Ankur Arora wrote: > On preempt_model_none() or preempt_model_voluntary() configurations > rescheduling of kernel threads happens only when they allow it, and > only at explicit preemption points, via calls to cond_resched() or > similar. > > That leaves out contexts where it is not convenient to periodically > call cond_resched() -- for instance when executing a potentially long > running primitive (such as REP; STOSB.) > So I said this not too long ago in the context of Xen PV, but maybe it's time to ask it in general: Why do we support anything other than full preempt? I can think of two reasons, neither of which I think is very good: 1. Once upon a time, tracking preempt state was expensive. But we fixed that. 2. Folklore suggests that there's a latency vs throughput tradeoff, and serious workloads, for some definition of serious, want throughput, so they should run without full preemption. I think #2 is a bit silly. If you want throughput, and you're busy waiting for a CPU that wants to run you, but it's not because it's running some low-priority non-preemptible thing (because preempt is set to none or volunary), you're not getting throughput. If you want to get keep some I/O resource busy to get throughput, but you have excessive latency getting scheduled, you don't get throughput. If the actual problem is that there's a workload that performs better when scheduling is delayed (which preempt=none and preempt=volunary do, essentialy at random), then maybe someone should identify that workload and fix the scheduler. So maybe we should just very strongly encourage everyone to run with full preempt and simplify the kernel?