From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755024AbcI0LX0 (ORCPT ); Tue, 27 Sep 2016 07:23:26 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:34627 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753173AbcI0LXT (ORCPT ); Tue, 27 Sep 2016 07:23:19 -0400 Subject: Re: [PATCH] kcov: properly check if we are in an interrupt To: Dmitry Vyukov , Peter Zijlstra References: <1474642273-112248-1-git-send-email-andreyknvl@google.com> <20160926163226.35cc76eb1a06083440cbb86d@linux-foundation.org> <20160927073409.GN2794@worktop> Cc: Andrew Morton , Andrey Konovalov , Nicolai Stange , Andrey Ryabinin , Kees Cook , James Morse , LKML , Quentin Casasnovas , Andrey Ryabinin , Thomas Gleixner , Ingo Molnar From: Vegard Nossum Message-ID: Date: Tue, 27 Sep 2016 13:22:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/27/2016 01:20 PM, Vegard Nossum wrote: > Your patch was: > > - if (!t || in_interrupt()) > + if (!t || (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_OFFSET > + | NMI_MASK))) > > But look at the definitions: > > #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \ > | NMI_MASK)) > #define in_interrupt() (irq_count()) > > So isn't the patch a no-op to start with? Eh, SOFTIRQ_OFFSET vs SOFTIRQ_MASK. I'll just go stand in the corner. Vegard