Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp658423lql; Mon, 11 Mar 2024 13:23:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgnf0fqz+IhFTRYGVCWaLydmpdse+To0SxauCukREZxwqomo4d/ndOcnqmgUXPWl7dcxFp6O5kBEu9tMBjcaOn9aFTybEmtvEUKf9DvA== X-Google-Smtp-Source: AGHT+IFrYL43eK8r6ddA5qsziKRypzOFjx2BiMcik4XK0AKSpVkht0pdhI7iYmIiydd4Oq4WOnwA X-Received: by 2002:a05:6a00:ad1:b0:6e6:767f:f807 with SMTP id c17-20020a056a000ad100b006e6767ff807mr7558783pfl.10.1710188626953; Mon, 11 Mar 2024 13:23:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710188626; cv=pass; d=google.com; s=arc-20160816; b=WrF6/Pf/cg8vyZkIJicbIpMAXCHJ58ndUbgtF+egAC/sT6Lk5q36eIpyDYLS6kQU+3 AUnWXxCytYi3ErVr4nTgwdq5PxNz6SgQTsUHH1pQMx8q0YeRcy1KxGJiQRHLc1xd3dMp TsvvKp8VWC1cT3voaJ9lPIYeif8dtaBOxcX2NY1S8MX2vxYXFlRx4SlDCyTGkuciJHaa LoousPGXFtbzE87UUheqaE3gidVfZMiIfABkefAJUjqBFkTlQt4UTBtgTwCOjzZvmGAl 5nQSqRuLqGMvXy75qsF59hcJgjwvGesMzR70tLdvLp8BQ+1RJp/9VhuXde4TsIJqEkcD TFfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=sYYV2YPuUOV751HqN2amVtf9CDdy1Ok2PE8ujxANnDs=; fh=EuYMmThTgEFvfBClkuz25zVu+/7tw3MlNHINbmW0ssQ=; b=KpeHm7q0xR2gVjAj+Vf2ZOkY+Bv/Wplh9dgiCCcULqhWjCgysMICJgAOxuxHjuORZ5 /7RLGdRJcjujNfVAiquGUSX4vxPUna5kzd7poMyr25ZzEtpoJiJh2mPBSzDFOW4uByOw 1hI8FCwtDD8soBKo1eZvMrqYySxbAeDydR/zQuXkEJtbFCD+KDZUGit5O6wLURFi7L5P 9I3hjDgz1JZyZRxYKbLM/heJgM5NI+FVEv+VmA8CZZylsYW4u4v2zmesQFE+NF9rJJVi f3kb523N3Vd7neYUkquYQHvkpowzmce4pDifVhTlBswk+INrFwzseCnrUd8kE6mQaH2I Evfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=H7Pd2iTg; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-99506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99506-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ko5-20020a056a00460500b006e6867ac406si4001235pfb.291.2024.03.11.13.23.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 13:23:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=H7Pd2iTg; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-99506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99506-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9A81F282137 for ; Mon, 11 Mar 2024 20:23:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54B8056B88; Mon, 11 Mar 2024 20:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="H7Pd2iTg" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 892BD56B78 for ; Mon, 11 Mar 2024 20:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710188610; cv=none; b=eLrfEmI6yuqOQ0SjGfke5BjG7chFYwDSL2GQXon+h1soRWfx7PM3xuO+JApiv1zeRM0MCXo6puW/iy6W+S1DPYb4QdkG70xgj/DKoRGZvftgr3jQLGoVSIjJY8Gb4+WjpASTXoUV6zi7OKBrpu6jd2nkqciX7hfh3H3ZZYznt5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710188610; c=relaxed/simple; bh=y144NH3QNOlKfjZ21peFLdhyR2kd90MOW/9E6QvpmtU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JgiEA18PeB1Ju9YHGdGqRNOygpe3hFAIRRMZV9xkS9BtSMVBNYj/TerFkNh5EQdVTlgYYWVlT7VNABQ+5ZI8GML7LfbgZM/QdRIl26mOMhuCVdA6ngTsvl/IjEA4pnUORKuyUqtaMtZ4L5gxL9cmJsJ8mYsNJmfuTHsAb67OZqY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=H7Pd2iTg; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-513b39eea3dso595724e87.2 for ; Mon, 11 Mar 2024 13:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1710188606; x=1710793406; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sYYV2YPuUOV751HqN2amVtf9CDdy1Ok2PE8ujxANnDs=; b=H7Pd2iTgEe05+++9D23R7vYKlO0cgI7YC7WUk92bjoHg6Bb/7KEjee5cF3w1/X9puK VrndBg8gytvtPlJ8ESvfH93Sz29GA227yQNNqMQni4lIX0QLw15gOm7i0Yq9z/6KwlNr KIA7zpYGteDiX1lGbQRSZfmFclQtCjy559u8E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710188606; x=1710793406; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sYYV2YPuUOV751HqN2amVtf9CDdy1Ok2PE8ujxANnDs=; b=et6KLrD1kGl3Yb7dCWdagoRBM4ivPXEGcAJoJG4CFOr7G0ER2fKQEoIjEpPmTLlOEc aT3LG+T6c60Q3pLwOGhXZycy3HvEiiEgBr/0h6ceg05w/GfsMTRgSZLA7r8MnibTEvHB C9i84Yg/VIz9FXwULMM+qYVfM+XTKDg49dBEdWyHrr+Q6dvsG2bc3HHHSoGU6UEg+l+7 dx0EU6x06oTlCcl+RGBcWUk0tQ2UMgwUfDxKeNo1QXQfl+FDj6+SXgjJ3Gar6XJcsNIO ZGKuRTPvKuwvJSZUILjnrb2AEh4RQ0Ng12+JHUVey9xKeGlwmGT3wWGvbJYuIFcBysG0 0pVA== X-Forwarded-Encrypted: i=1; AJvYcCVe0ohNCZtsFSGLrgfsvg4G4R/J5N8wu7Jvk9dSkAMYU6g3h/Tt/MvlO+gxMpQy1QvdLHWW4vWKX9NdxIqsPpGEDWG+xN1F88Z3W1mN X-Gm-Message-State: AOJu0YxQhtRC6KOz1DWW5W2DC5ojL58gZZNjD9YiX0vz5H+ueS/7y3BA sV1Sdffr5fozgVcLo/SKFMuMYTJnoNJ+ZxP/EfneqwPfTc0dHVgmCIQ+jesa5RU9JbXvec9Kuf9 DSHI= X-Received: by 2002:ac2:46d7:0:b0:512:cc50:c3e0 with SMTP id p23-20020ac246d7000000b00512cc50c3e0mr1004679lfo.52.1710188606567; Mon, 11 Mar 2024 13:23:26 -0700 (PDT) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id d4-20020a1709064c4400b00a44dca5f9c1sm3150926ejw.100.2024.03.11.13.23.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Mar 2024 13:23:25 -0700 (PDT) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a44cdb2d3a6so674471066b.2 for ; Mon, 11 Mar 2024 13:23:25 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWewu/amWHGxCPXrZYSgwHNoImcoMNGk3eOoDK2s6suiGihPJtuOpYvFnLhe+k18g9qb2O/Su3FPniO2KL+QYDIbM7r1S8FlFAJAl3u X-Received: by 2002:a17:906:3ac9:b0:a46:2874:ecd5 with SMTP id z9-20020a1709063ac900b00a462874ecd5mr985599ejd.55.1710188605245; Mon, 11 Mar 2024 13:23:25 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240213055554.1802415-27-ankur.a.arora@oracle.com> <65e3cd87.050a0220.bc052.7a29@mx.google.com> <87frx514jz.fsf@oracle.com> <12a20651-5429-43df-88d7-9d01ff6212c6@joelfernandes.org> <63380f0a-329c-43df-8e6c-4818de5eb371@paulmck-laptop> <6054a8e0-eb95-45a3-9901-fe2a31b6fe4e@paulmck-laptop> <87plw5pd2x.fsf@oracle.com> <87wmq9mkx2.fsf@oracle.com> <36eef8c5-8ecd-4c90-8851-1c2ab342e2bb@paulmck-laptop> <87cys0il7x.fsf@oracle.com> In-Reply-To: <87cys0il7x.fsf@oracle.com> From: Linus Torvalds Date: Mon, 11 Mar 2024 13:23:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 26/30] sched: handle preempt=voluntary under PREEMPT_AUTO To: Ankur Arora Cc: paulmck@kernel.org, Joel Fernandes , linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.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, willy@infradead.org, mgorman@suse.de, jpoimboe@kernel.org, mark.rutland@arm.com, jgross@suse.com, andrew.cooper3@citrix.com, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, rostedt@goodmis.org, David.Laight@aculab.com, richard@nod.at, mjguzik@gmail.com, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Content-Type: text/plain; charset="UTF-8" On Mon, 11 Mar 2024 at 13:10, Ankur Arora wrote: > > Ah, I see your point. Basically, keep the lazy semantics but -- in > addition -- also provide the ability to dynamically toggle > cond_resched(), might_reshed() as a feature to help move this along > further. Please, let's not make up any random hypotheticals. Honestly, if we ever hit the hypothetical scenario that Paul outlined, let's (a) deal with it THEN, when we actually know what the situation is (b) learn and document what it is that actually causes the odd behavior IOW, instead of assuming that some "cond_resched()" case would even be the right thing to do, maybe there are other issues going on? Let's not paper over them by keeping some hack around - and *if* some cond_resched() model is actually the right model in some individual place, let's make it the rule that *when* we hit that case, we document it. And we should absolutely not have some hypothetical case keep us from just doing the right thing and getting rid of the existing cond_resched(). Because any potential future case is *not* going to be the same cond_resched() that the current case is anyway. It is going to have some very different cause. Linus