Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1192639rdb; Fri, 9 Feb 2024 13:18:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQ5NB+JSCZo8C3z4TCTjzPkYuxJ0zxpDMN5N4iL0LAjkTKTHtseCI4dq91c5qop8B3OncV X-Received: by 2002:ac2:4ec2:0:b0:511:4a6e:862b with SMTP id p2-20020ac24ec2000000b005114a6e862bmr120968lfr.43.1707513517427; Fri, 09 Feb 2024 13:18:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707513517; cv=pass; d=google.com; s=arc-20160816; b=EOwHv4AjZw/LAsYQzGGt2bNLb/L3pakx7Dk4LJSN0uFxF2+iZJFK3VzdZBLwli5p11 MHQ6BZfmx7ayYM7qBAgdKU/BeaTmoUojgUTHmczUi89Th83V9y9f4mmUEFi+8NT+VOPU TJM/PxlN3r9rT1nGMgdlR9Pm6AgnWDnDOEK4H/lNnZAaji1iLV83StipNewOFaOxGIC2 vDM/HiYhHEoPgWjQHttqeyePR+iZQF6D2ruzg9ytAAipz20KT1/BeEmQ2YxKyFxRvPIP tKaZEw5YGvPDYcVBJwCHaCo2KKuDfj1y+2R3CrKl15EqUteHFrkDVetA9B5qYdJrg+RL S4/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=igW5qMYdaoU4Ns1rRfgy6a4LWuDyFB8UF5Qben4fglo=; fh=Wx+ZvKno9goxzq04hhAKlGEVRUoz7iyshcN8OcE/6aE=; b=BV4tXXWXECaUMGWrDhNK9FEX6zWiTGwhcUB705VAHKxZOVOfPrWk4hbkeIGp1DEMhi IYkjYr10mc7wTuhBHOLcvcWiS4aDQnJz1T3Oj64ZmCokyi0SKt9XEc+zD2PjdZ6NUtEa /frHLFSsCHHCVT6oZmz7cttgx9DWBgIcqhv2rrxQWGbAlOMgE/dE3oQDyRSMNEpOvGQQ ctVf0gsOdPWj4N7cvX6M3EWP66YLQhtr48pNHE8vBjI/iAJ62OIh6EmtoSyOeWXv6eFn SNepnKJHjlihWYRsdrX6lk7AsrT8OxfVypcICfGu/rXbnf45eynXF0EkgE79gFi+AYFU Cgpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Us0Uyhor; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-60012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60012-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCX8tDKsCo9f+cbztM8W0PtqBBDdYEYIPhYah8jEm5zmR+Y4jwXgVWeWoIkjeZdfFgFeMstNzQgLCm02OvEdCTFTBxGUIeFr4hNyCvCpKQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cf22-20020a170906b2d600b00a3c23cb31c3si49179ejb.612.2024.02.09.13.18.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:18:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Us0Uyhor; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-60012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60012-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2911B1F237EA for ; Fri, 9 Feb 2024 21:18:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F7AC364A9; Fri, 9 Feb 2024 21:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Us0Uyhor" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 27ED851C34; Fri, 9 Feb 2024 21:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513032; cv=none; b=ixV9qDLuCjAh4Ks8g+uiQQvIx6f6acaLpeyHubC+AY/rm3/NMEb0Q1hyx06lq4Cce6P/AqSdDbM3h92/SsZdYtV+baNlzI3X43JlYulsXVzMELh7K8VG7t4lYo34rcCwbiZgYH7ZNPGi02P/Lh+Tv1JulJN7BpIpz63Tb/JiSLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707513032; c=relaxed/simple; bh=UTi0h2ycj+oFBZj+dMWCDX4ZHwh89gcGHMCf1OfIwwQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uFAYFjl3oCw7wQ2YBCY0cVPM1Q+If9r6WQyVvvArzbfhtNkShWEe/Oy0kppZXQ6veIbFxG6cRNpP3xF2PhLNMsDaAi6ZmlRO8NYuJx1X3cM6LQHKq6MpfdAcpsVbXK/fW8Gercym32OQXNjspew3sFxONnyCoRvdR44tBYmWaiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Us0Uyhor; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707513031; x=1739049031; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UTi0h2ycj+oFBZj+dMWCDX4ZHwh89gcGHMCf1OfIwwQ=; b=Us0UyhorttjtXQAMO2KBkcHZttCuECcABMSaUEpKfJUvicdrVJL59EUh IE83Wz2yQhKQW5uoUF9iNJJJTUiUuli13wkD/sSj4qrJt5a2L3iP5jq7G 5OQdiVgzETlzQ/JrVXvPg8qp9MkCKnKjnjFyv1HfidntAf6joLujFHw3P ZNatMb0DDRMvafaltImVBYHuoDZ4nsZkItkCHcGTlPlyT/uBtTjuhVBuC 1Ia8lZJsJq2fnSfHCQQr7hDs0ZgetQ8p/uWl2p1whmH/yNGpuqR3geYTo d0bfnDwTCvr5e6O0JdtW30GQCsUBsQT4P8+30ryEVLk3GcgSLhNwiX9Dx A==; X-IronPort-AV: E=McAfee;i="6600,9927,10979"; a="1382166" X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="1382166" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: > 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