From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E47DA1D0F4F for ; Tue, 19 Nov 2024 16:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732035370; cv=none; b=Bav7dYiS+4ZSFiEqk4fl3REAFbvly3zCQe9yxESeQaG4aWBaOe1nC7ssb0Bt3+IWHDfJUjQ1vNYFJyxwy+TNZAtHxzxEk2aqL+xDXMxS93z9zx4xKQpmm2g0iQw/Nn+qtFQne2WAR/KcznR2fBtWKbwlnZRCT0/DbvOTCc4QHNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732035370; c=relaxed/simple; bh=1qHk9c9UF1EeKWWeqbF/56RTbbac9fdZn150Ee2pIlM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jFvoZGnuqhNDF0DbVlZZ9HRChET9hv73KL86PjbhPj9bFc+HroKjqNO++n5h/QiLrGrHv1aBvaJis6VHlFJSKc/olWPBxcRIZZeWSGlWrTRkX+4t46KMO81FDcoKlO2ROPX2ZC66TcNq9Qa460dK/52YuGXEnkjdk4+TUZFJevI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ArManeJs; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ArManeJs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732035365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eZY2bvI9jRohMLC1MiiilGj8lvWI0aPVX7q2WlrGEVY=; b=ArManeJs1uqTSLW//b8hp2lTW4lvSD73Sd23xPTvFHlQFaA1RRp29mkYObAiCv1dPusrun cIp3PLdnN8GrSGf+RlkEFHRgHhM8mLnJfTe5q9ogluoT/f6Zr18C4N1i0XlKbpP3j/GpFi x1MOS1eKwKWafw7ZN+BUk+uCB7Ux0l8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-Von8AFHlPcutkbqohtcFAg-1; Tue, 19 Nov 2024 11:56:00 -0500 X-MC-Unique: Von8AFHlPcutkbqohtcFAg-1 X-Mimecast-MFC-AGG-ID: Von8AFHlPcutkbqohtcFAg Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E7A419560AD; Tue, 19 Nov 2024 16:55:58 +0000 (UTC) Received: from localhost (unknown [10.22.89.254]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 933AB1956086; Tue, 19 Nov 2024 16:55:56 +0000 (UTC) Date: Tue, 19 Nov 2024 13:55:55 -0300 From: "Luis Claudio R. Goncalves" To: Sebastian Andrzej Siewior Cc: Thierry Reding , Krishna Reddy , Will Deacon , Robin Murphy , Joerg Roedel , Jonathan Hunter , linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, Steven Rostedt , linux-rt-devel@lists.linux.dev Subject: Re: [PATCH] iommu/tegra241-cmdqv: do not call smp_processor_id in preemptible context Message-ID: References: <20241119071510.-6OKEw2q@linutronix.de> Precedence: bulk X-Mailing-List: linux-rt-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241119071510.-6OKEw2q@linutronix.de> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 On Tue, Nov 19, 2024 at 08:15:10AM +0100, Sebastian Andrzej Siewior wrote: > On 2024-11-18 21:19:28 [-0300], Luis Claudio R. Goncalves wrote: > > With PREEMPT_RT enabled some of the calls to tegra241_cmdqv_get_cmdq() > > during boot will happen in preemptible context. As this function calls > > smp_processor_id(), these calls will trigger a "BUG: using smp_processor_id() > > in preemptible" backtrace if DEBUG_PREEMPT is enabled. > > If this is only on PREEMPT_RT, where is the disabled preemption coming > from on !PREEMPT_RT? You are correct. This is not exclusive to PREEMPT_RT, also happens with the stock kernel. I ran more tests and this time I made sure DEBUG_PREEMPT was enabled. That was enough to reproduce the problem. > > As tegra241_cmdqv_get_cmdq() only calls smp_processor_id() to use the > > CPU number as a factor to balance out traffic on cmdq usage, it is safe > > to use raw_smp_processor_id() here. > > > > Signed-off-by: Luis Claudio R. Goncalves > > Sebastian > ---end quoted text---