From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEEA6C48297 for ; Fri, 9 Feb 2024 21:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NfEsxviFb0RNe+AwE0jNdM6wSAxnKOAZlB8GDT4dPLk=; b=i5SXNIiqJJ1+of jR6HBSzf2YxQ1M+spsEK1oWZkcauohnrzG4EPaJe7cD/rGe4WQO32IFNXOnxRyb58fOvP6qE4yMrc aGv3KDfqpAkWToXV1mbtabqoJyio/cXVWtt4jPHtRkXSFgUnoJL8iGamOc+TKCpNuUAMN5UO4Dxxt rkmeieSUftX1iySyWR69slRTg4qaVkdJS4b2Tg+dhVVNh3E6QMfhghehMKoAKecJaVTHmZndYlpT1 PHKX7yhb+NCpZ5biJmV1PS4q6xi+MXM5UYD75u6P8Ut1ooLfjey3PLigG1RxQiExu++/Moo/DTb4D Xn4zrlpGCJAou16HgM4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYY8m-00000000ayx-3N9f; Fri, 09 Feb 2024 21:10:32 +0000 Received: from mgamail.intel.com ([192.198.163.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYY8k-00000000axf-00hL for linux-arm-kernel@lists.infradead.org; Fri, 09 Feb 2024 21:10:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707513030; x=1739049030; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UTi0h2ycj+oFBZj+dMWCDX4ZHwh89gcGHMCf1OfIwwQ=; b=egLPX4/G0i3EL7ZsUF7gOx3t2uRwhj5Nz7tZ0bmZk3myr3Gpw60R7o7Q mtpPI1l0LPFbF0sQnXei+SRmGfLdoKjqy5cEomhM5Oq2oNboEXaaUzSkx iC6S5+omA8L84NL7Os+kppyvIx+LRgPSN3qG/63x9cvSe4y9UHUxlbgFS zhJKmZnN+HGwHZmuY4uAWXSRVHOKkJ99fGohEZFUPdlYpW0Q4NnVxP+4P CI4Hoti9f8CIq94rSaSRzo2SASigLb1QroFnx2JkqFI3Lw2LrvZwgzn4x T/GwaKWaOtn0iNKUcx2IPMd/b5cnpvH4t5ZbBKt2jte1g2mPUrE0xieEx w==; X-IronPort-AV: E=McAfee;i="6600,9927,10979"; a="1382170" X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="1382170" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 13:10:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="2243886" Received: from tassilo.jf.intel.com (HELO tassilo) ([10.54.38.190]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 13:10:28 -0800 Date: Fri, 9 Feb 2024 13:10:27 -0800 From: Andi Kleen To: Adrian Hunter Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Heiko Carstens , Thomas Richter , Hendrik Brueckner , Suzuki K Poulose , Mike Leach , James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Yicong Yang , Jonathan Cameron , Will Deacon , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH V5 01/12] perf/core: Add aux_pause, aux_resume, aux_start_paused Message-ID: References: <20240208113127.22216-1-adrian.hunter@intel.com> <20240208113127.22216-2-adrian.hunter@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240209_131030_077690_5315BEF2 X-CRM114-Status: GOOD ( 10.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > The writes to rb->aux_in_pause_resume must be done > only once. It might be possible to get away without > WRITE_ONCE(), but really the compiler should be informed > not to make assumptions. What stops the NMI from firing here? > >> + if (READ_ONCE(rb->aux_in_pause_resume)) > >> + /* Guard against NMI, NMI loses here */ > >> + goto out_restore; <----------------------- NMI > >> + WRITE_ONCE(rb->aux_in_pause_resume, 1); Even if it isn't racy it needs a clear comment. -Andi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel