Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2002133imw; Tue, 5 Jul 2022 20:47:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vdyNJoO6KaMW8EOaAyzzIijpFYm3A8s/wryMIjD8rzngIZnIcn/w2OQ71OK5xi0v5HqtjU X-Received: by 2002:a17:907:75cc:b0:726:f11c:4c5c with SMTP id jl12-20020a17090775cc00b00726f11c4c5cmr37425711ejc.404.1657079228428; Tue, 05 Jul 2022 20:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657079228; cv=none; d=google.com; s=arc-20160816; b=eT/t+fn/TDlvv82Ze3EcmrXSGyJpwLLkOQAWe6WMQ/LBkS5DpBSnx9HNepSF8LrRPh 3pWxuzBp/WJHDPMYbtmn1TuOeIzeUKYHQqg1qwbR8C4aq/xnmPXYL95ndqvyenovIeeR 9R2UYCrSJXeHHdWcjBmbyeNhX+62oxmPV8QOqDx5nkhoMs0JuiAoPLJGHRKjlx8cwU1W TVzhPxPmK7GdXrwbTuetuImg0w/fan+N1qYjqlNf8jwXYppFEPmRUBZqeL2JYPS1ZEyj fHlTZ7D0K9w8HAlgRjpkkOZ4qBOE1S73qKJGwIcRFjKgR8kLSBwR8FWiarH6Y47k4XGc fGxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=aIw+qYPgwNY5VI1B0vDeShD58+usuE8lYmG7gBeu15s=; b=JiUbDUE3JpSocAsL+yQDMMkg+FxNRbnz0zhq3jQVwwCvLJLM59g/o25l2Hwp2JiDoy Qz7eYWEkSht6twvsbH1cqffukQXwISUUxcnx3uN1vjjyGyqOtn4obj323mcKF1t6eq2H 1hibI7Uv4Cj6tnf4++ZwNN9wpCqogdwrgx7AevRCd+qK9MEhYWZ9EycwH27R5Px6GPkA C/sfpvKKYT/hBA68thfuo3/PanhHBKSK6q1fzM2qgnp7T8THzkdPlHz7XPgOmiyc+Zb0 NifECf/ptN/WEvrV1Zb5kH67UH517KXFfVIE/Tkj48t82qjxysuKdZpmCgi6FITlWVFx QBng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ixsUaPT8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x3-20020a05640226c300b0043571fa0fcasi29406567edd.449.2022.07.05.20.46.44; Tue, 05 Jul 2022 20:47:08 -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; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ixsUaPT8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230313AbiGFDoQ (ORCPT + 99 others); Tue, 5 Jul 2022 23:44:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbiGFDoN (ORCPT ); Tue, 5 Jul 2022 23:44:13 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53CD1167EF for ; Tue, 5 Jul 2022 20:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657079051; x=1688615051; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=aIw+qYPgwNY5VI1B0vDeShD58+usuE8lYmG7gBeu15s=; b=ixsUaPT8NdSUvHOY+MkSSzuwpluijrwLzxjPOw09Usf7jrvQGZmriFgS Guf2NtGo1xHoNdQH3+5s1q0MYjYBAq61I0HYBn/vDNibXGRoV+tRmSFoI UDFoPlN5DYI0eNJnAYr+4bZ44y/v3HvzBrtryO5fw3qhTIpmY8mArJrZH w=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 05 Jul 2022 20:44:11 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 20:44:10 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 5 Jul 2022 20:44:10 -0700 Received: from [10.47.234.156] (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 5 Jul 2022 20:44:09 -0700 Subject: Re: [PATCH] sched: fix rq lock recursion issue To: Steven Rostedt CC: , , , , , , , , , References: <20220624074240.13108-1-quic_satyap@quicinc.com> <20220701115453.259b17e6@gandalf.local.home> From: Satya Durga Srinivasu Prabhala Message-ID: <006eb3a2-acc0-3d65-f7cb-2abb6f5aadd1@quicinc.com> Date: Tue, 5 Jul 2022 20:44:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20220701115453.259b17e6@gandalf.local.home> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 7/1/22 8:54 AM, Steven Rostedt wrote: > 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()? I'm not sure, why we have migrate_disable/enable(). I will need to cross check further. > > 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(). Thanks for the inputs. I still need to cross check and find a better way to repro the issue to be able to comment further. Will cross check on your suggestion. > > -- Steve