Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1557084ybl; Sat, 25 Jan 2020 03:23:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyszaAK5uU4kHBe1SXmaNPZdEsQV3ggGE38+H0ih0XPFLPETlSQl6fg8wdtBA8yZV+uTcXE X-Received: by 2002:aca:fcc1:: with SMTP id a184mr862457oii.36.1579951394445; Sat, 25 Jan 2020 03:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579951394; cv=none; d=google.com; s=arc-20160816; b=Lpu2cRvtjYeeervVFFNRHjwzsss6gmKyTfljSttQKS4Ynxh0c69iT0mpkF77OaDJSW eX9Id87sjipdemhtbMeNeysZVtHzhc8a991xdHcPApWs8zpBYlT64CQ51Yf5gi8BbQRX Gj80xPepv4zn1JxieC91bs8OlwOgg1dpvGMs/tl0/JE1m29KQ9Ma31QyGx6pr76HkeND JXggtWqW/Pv8X+5flasiiu2BWTYHjcGhLGNMpdmAtDWTS1NNWzo7Shu6KQdg5ktzHjwF s/MBuQFLrtCFvec6m+ab18CmDY9WcFu2MYd+PEQSoxV/H/VWQKZRiCbqv9eTGgirPCfy KlUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LQclcc/iHz+UluZUUVN5bYPkULWxZm0NAtmv8jLa33E=; b=DKRM2onTQiv/Gtxf0aLkIcP5BhBBaQA9C5K60wX/1W9xwRcNvQFFgm9vKt1JHZcS2b h602H3SYJuKG9MmAhbdNQ9RJdExyOmHmdpkRLrDsCJKrj8QtRAlDNcIugrWktXp+QOOB byji0KGsTGYcN4E/BnM0KohlT2E4/tolRBxNZEnf2lbbeCMerOhjS5q7AbNcZGspIGex IUh7xP0SjirkCmrOuwhkPgV3wQqK1QfT7VKS1SUGpaNvgh1W4G4XTI5/5dL1VY6wHW/A zY9L9UcKHe48jKbLnRSSp2zM2A56nAiQ/e97wO176s3J+7TzUWUfttZKMAxFFOKEY33z fguQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UOyLhHIT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si1032567oib.164.2020.01.25.03.23.01; Sat, 25 Jan 2020 03:23:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=UOyLhHIT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728809AbgAYLU7 (ORCPT + 99 others); Sat, 25 Jan 2020 06:20:59 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52478 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgAYLU6 (ORCPT ); Sat, 25 Jan 2020 06:20:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LQclcc/iHz+UluZUUVN5bYPkULWxZm0NAtmv8jLa33E=; b=UOyLhHITbrqmU2/KnPPEmd42/ 2LlBjJTe2clynX01qlgxdIY0tm6AtJHMWdcXKGohJRUOyr747Iio0zP7Pr92dUSGNwJyXyg89kxmT YZS0pts0CkUg2PzsMbmJNLK9XEPjyaMMNVGZGQ8ZZ2+CnqeqUvD18yqkqSEG0hNGTQkdOc5yU63pb pNKyir/P9IUZZzl7tfR/u69bxmpAYZR4YBHKZYvKwoD/mkA94Nm1goYRBMZG0D6+vw0ZcPY3DfBPc PJepegAWFbwhrA/JJuBMfBc/opFgbcmk0wUNgD+orUvKn5Pn44FSMCEWf4D3lCmB4/2j0JKdMRkju R2evE6eKg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ivJUY-0005d4-0o; Sat, 25 Jan 2020 11:20:42 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 1F4A2980BB0; Sat, 25 Jan 2020 12:20:39 +0100 (CET) Date: Sat, 25 Jan 2020 12:20:39 +0100 From: Peter Zijlstra To: Waiman Long Cc: Alex Kogan , linux@armlinux.org.uk, Ingo Molnar , Will Deacon , Arnd Bergmann , linux-arch@vger.kernel.org, linux-arm-kernel , linux-kernel@vger.kernel.org, Thomas Gleixner , Borislav Petkov , hpa@zytor.com, x86@kernel.org, Hanjun Guo , Jan Glauber , Steven Sistare , Daniel Jordan , dave.dice@oracle.com Subject: Re: [PATCH v8 4/5] locking/qspinlock: Introduce starvation avoidance into CNA Message-ID: <20200125112039.GX11457@worktop.programming.kicks-ass.net> References: <3862F8A1-FF9B-40AD-A88E-2C0BA7AF6F58@oracle.com> <20200124075235.GX14914@hirez.programming.kicks-ass.net> <2c6741c5-d89d-4b2c-cebe-a7c7f6eed884@redhat.com> <48ce49e5-98a7-23cd-09f4-8290a65abbb5@redhat.com> <8D3AFB47-B595-418C-9568-08780DDC58FF@oracle.com> <714892cd-d96f-4d41-ae8b-d7b7642a6e3c@redhat.com> <1669BFDE-A1A5-4ED8-B586-035460BBF68A@oracle.com> <45660873-731a-a810-8c57-1a5a19d266b4@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 24, 2020 at 01:51:34PM -0500, Waiman Long wrote: < 71 lines of garbage > > > You can use the in_task() macro in include/linux/preempt.h. This is > > just a percpu preempt_count read and test. If in_task() is false, it > > is in a {soft|hard}irq or nmi context. If it is true, you can check > > the rt_task() macro to see if it is an RT task. That will access to > > the current task structure. So it may cost a little bit more if you > > want to handle the RT task the same way. > > > We may not need to do that for softIRQ context. If that is the case, you > can use in_irq() which checks for hardirq and nmi only. Peter, what is > your thought on that? Can you lot please start trimming emails when you reply?