Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1361371rdb; Mon, 2 Oct 2023 07:22:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+NwWhxhFknsLbaoPxl6uNztWvllzuBt97qEa7uIrw+yWv+72jFMa2XO+tE7tms/eMcyv3 X-Received: by 2002:a17:90b:1498:b0:26d:49a0:2071 with SMTP id js24-20020a17090b149800b0026d49a02071mr17660731pjb.13.1696256557235; Mon, 02 Oct 2023 07:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696256557; cv=none; d=google.com; s=arc-20160816; b=VrLjZ0USNny4d/5bHzbE4gh6Wtcm3Bj40PBxJWTj2CXAHUH9q1q5vIfV7iaGnfKZ69 fshgHxjTAvX94vPVSTP2n6gf63yw2+Rnh1ABqKs6S7cuP6pMsQRKoHrYuVRxEgRRTrG8 x5CxvrcRzGhB3IibReyIWq0amo7HQfEPDvn0apyh5M7fI491RFbw/Z+BpjeGi4dVXYEC 3pGzOW6uatr4QKXZb2Ab64y7YvFBCdrVXz9lqxsLrMbBubaVnd2LUJ5LkOmHY+CAFq7L IHakDDwxE8gWH5WnQVSNK5bav+o5kAB4iFIoueWQquU+86XxNZtVaM8tzv2B+5xiozRc 2cWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=r5jDPnQEkQR8/RzF14rOTh54Zk1HLBP+qiPt79K/Q+M=; fh=Ua6pRlXPWW2B73iWKMVGv8ZFSVer0DdshHo8ag8/Ico=; b=gpB8u399FxPEUibOWtXJFsv1YoMueIR6Z0TAKk8Bg3/IHm0OQWAiWBMkQgyXBHC3Wk 6auHsTbKQjBVSNmvvlUk2U9PAEKhJmznvL4vhxoC/ioMkTaB+XwjrTufNg7b4FjzaIuI lcTJrj+0RKSDheJJLAuTY23GBs0Q2g5TdAJfbB3u4Kmk3j3VRnNdLr21Jih6CMru3/SG mcILzFn/w222zQ41fXYj5QAnH3adxE0qV5MCEZugG41et8FGQ8ER9rOKMDTEj7La7r9c 02hbG9eh9RhDPPGFDku/TTJAHHlKvikEmM8TXhrjTCvLOpPx6stWGDxu1QIgzjPwUPg4 dbwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s3-20020a17090aad8300b0027901ee93fbsi7648435pjq.156.2023.10.02.07.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 07:22:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C667C802F447; Mon, 2 Oct 2023 07:14:28 -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 S237479AbjJBOOS (ORCPT + 99 others); Mon, 2 Oct 2023 10:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237539AbjJBOOR (ORCPT ); Mon, 2 Oct 2023 10:14:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 601A0A4 for ; Mon, 2 Oct 2023 07:14:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DAD8C433C8; Mon, 2 Oct 2023 14:14:11 +0000 (UTC) Date: Mon, 2 Oct 2023 10:15:14 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: Linus Torvalds , Peter Zijlstra , 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, willy@infradead.org, mgorman@suse.de, 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, Frederic Weisbecker Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED Message-ID: <20231002101514.44b9c812@gandalf.local.home> In-Reply-To: <87jzshhexi.ffs@tglx> References: <87ttrngmq0.ffs@tglx> <87jzshhexi.ffs@tglx> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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, 02 Oct 2023 07:14:28 -0700 (PDT) On Sat, 23 Sep 2023 03:11:05 +0200 Thomas Gleixner wrote: > Though definitely I'm putting a permanent NAK in place for any attempts > to duct tape the preempt=NONE model any further by sprinkling more > cond*() and whatever warts around. Well, until we have this fix in, we will still need to sprinkle those around when they are triggering watchdog timeouts. I just had to add one recently due to a timeout report :-( > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -2722,6 +2722,8 @@ unsigned int tracing_gen_ctx_irq_test(un > > if (tif_need_resched()) > trace_flags |= TRACE_FLAG_NEED_RESCHED; > + if (tif_need_resched_lazy()) > + trace_flags |= TRACE_FLAG_NEED_RESCHED_LAZY; > if (test_preempt_need_resched()) > trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; > return (trace_flags << 16) | (min_t(unsigned int, pc & 0xff, 0xf)) | > --- a/include/linux/trace_events.h > +++ b/include/linux/trace_events.h > @@ -178,8 +178,8 @@ unsigned int tracing_gen_ctx_irq_test(un > > enum trace_flag_type { > TRACE_FLAG_IRQS_OFF = 0x01, > - TRACE_FLAG_IRQS_NOSUPPORT = 0x02, I never cared for that NOSUPPORT flag. It's from 2008 and only used by archs that do not support irq tracing (aka lockdep). I'm fine with dropping it and just updating the user space libraries (which will no longer see it not supported, but that's fine with me). > - TRACE_FLAG_NEED_RESCHED = 0x04, > + TRACE_FLAG_NEED_RESCHED = 0x02, > + TRACE_FLAG_NEED_RESCHED_LAZY = 0x04, Is LAZY only used for PREEMPT_NONE? Or do we use it for CONFIG_PREEMPT? Because, NEED_RESCHED is known, and moving that to bit 2 will break user space. Having LAZY replace the IRQS_NOSUPPORT will cause the least "breakage". -- Steve > TRACE_FLAG_HARDIRQ = 0x08, > TRACE_FLAG_SOFTIRQ = 0x10, > TRACE_FLAG_PREEMPT_RESCHED = 0x20, > @@ -205,11 +205,11 @@ static inline unsigned int tracing_gen_c > > static inline unsigned int tracing_gen_ctx_flags(unsigned long irqflags) > { > - return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); > + return tracing_gen_ctx_irq_test(0); > } > static inline unsigned int tracing_gen_ctx(void) > { > - return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); > + return tracing_gen_ctx_irq_test(0); > } > #endif > > --- a/kernel/trace/trace_output.c > +++ b/kernel/trace/trace_output.c > @@ -460,17 +460,29 @@ int trace_print_lat_fmt(struct trace_seq > (entry->flags & TRACE_FLAG_IRQS_OFF && bh_off) ? 'D' : > (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : > bh_off ? 'b' : > - (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 'X' : > + !IS_ENABLED(CONFIG_TRACE_IRQFLAGS_SUPPORT) ? 'X' : > '.'; > > - switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | > + switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY | > TRACE_FLAG_PREEMPT_RESCHED)) { > + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_PREEMPT_RESCHED: > + need_resched = 'B'; > + break; > case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_PREEMPT_RESCHED: > need_resched = 'N'; > break; > + case TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_PREEMPT_RESCHED: > + need_resched = 'L'; > + break; > + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY: > + need_resched = 'b'; > + break; > case TRACE_FLAG_NEED_RESCHED: > need_resched = 'n'; > break; > + case TRACE_FLAG_NEED_RESCHED_LAZY: > + need_resched = 'l'; > + break; > case TRACE_FLAG_PREEMPT_RESCHED: > need_resched = 'p'; > break;