Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp44045imn; Fri, 1 Jul 2022 09:34:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1viJaS0Y42+7J9I+gjIZuY6mmzb3xn6bOaGaU0jXe9gyR2nfrWsvsQgf3x3RdmsBI8rrOYB X-Received: by 2002:a05:6402:360d:b0:435:710a:2531 with SMTP id el13-20020a056402360d00b00435710a2531mr19699873edb.377.1656693260878; Fri, 01 Jul 2022 09:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656693260; cv=none; d=google.com; s=arc-20160816; b=0XkCifI/elNvFqRX01gfGunb7ifxmOGfhpgBwKh62A7Wh9AmPOn+xQ4qwPkBdEg4v7 tYwyB0Te7xfqW89SuMCmY9F4jSipdwXTwuHDD0qQav970EtIzovjJjutsGkPKcwioJaN J7mha1EwwMizeIOdfGEK+Fbydav8TO6WRBYcg0IQFCStbwnWQB45N2dc/HBAh0kLBlWW xDSfYnt64ZFOpg/5io8Gu8te6Je7nhMppqMAQGJCn3fWKKjoKIPi3Nzaz4mpm7brjysQ I4gjxtLUngMDuwGRypPTf8G+SPoAaS6EgbzeU9S5Q9Fu3rRcKMz6svH5acC0P2p7sdhN WLYQ== 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=xILf6i/ydm1dEfwTo2MMJjrUSvU+w2Va/CUWbctrhUY=; b=rdVPvZHsUSutEjSHAz4zivTQut2RUw4A+++OLOYDSiUkphGdwzI2F4wAOkjw57Avjf y9PXrF1G2yFa7jxipGXvb/WFUequdB7rSYZ0yozta4c9C6x12u+ovYMGDSmXmZR1R8Yc pthgVuErSCZlo5bvbUH1SzX+m5GHUTmrloyYH3bPnqUCI4f29GZIJLsWNBofpM6QKWHX LW8m7Igg9Z5ZvYHr2Wr2VyINOavmCd0KYhWCdM1+oURzX7vUFBdtKzUKBN55eG9hG61h C1U3CsAt961tn/XwSaHOZRVX3SkgDAzLh6T6YFk7quVEt1usH52Gs+v8NOhkovr2c6/w IZ2g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a056402500b00b00437deb23714si220881eda.511.2022.07.01.09.33.56; Fri, 01 Jul 2022 09:34:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230333AbiGAPy6 (ORCPT + 99 others); Fri, 1 Jul 2022 11:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbiGAPy5 (ORCPT ); Fri, 1 Jul 2022 11:54:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C89ED15FC7 for ; Fri, 1 Jul 2022 08:54:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 64CB5622F8 for ; Fri, 1 Jul 2022 15:54:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC97C341C7; Fri, 1 Jul 2022 15:54:54 +0000 (UTC) Date: Fri, 1 Jul 2022 11:54:53 -0400 From: Steven Rostedt To: Satya Durga Srinivasu Prabhala Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched: fix rq lock recursion issue Message-ID: <20220701115453.259b17e6@gandalf.local.home> In-Reply-To: References: <20220624074240.13108-1-quic_satyap@quicinc.com> X-Mailer: Claws Mail 3.17.8 (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=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, 30 Jun 2022 18:37:04 -0400 Steven Rostedt wrote: > > > > Fix the issue by switching to preempt_enable/disable() for non-RT > > Kernels. > > > > -010 |spin_bug(lock = ???, msg = ???) > > -011 |debug_spin_lock_before(inline) > > -011 |do_raw_spin_lock(lock = 0xFFFFFF89323BB600) > > -012 |_raw_spin_lock(inline) > > -012 |raw_spin_rq_lock_nested(inline) > > -012 |raw_spin_rq_lock(inline) > > -012 |task_rq_lock(p = 0xFFFFFF88CFF1DA00, rf = 0xFFFFFFC03707BBE8) > > -013 |__set_cpus_allowed_ptr(inline) > > -013 |migrate_enable() > > -014 |trace_call_bpf(call = ?, ctx = 0xFFFFFFFDEF954600) > > -015 |perf_trace_run_bpf_submit(inline) > > -015 |perf_trace_sched_switch(__data = 0xFFFFFFE82CF0BCB8, preempt = FALSE, prev = ?, next = ?) > > -016 |__traceiter_sched_switch(inline) > > -016 |trace_sched_switch(inline) > > trace_sched_switch() disables preemption. > > So how is this a fix? Let me rephrase my question. As trace_sched_switch() disables preemption, why is trace_call_bpf() calling migrate_disable()? Looks like you could modify the code to include a __bpf_prog_run_array() that skips the migrate_disable(). You even have a "cant_sleep()" call in trace_call_bpf(). -- Steve