Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2838040rdb; Wed, 15 Nov 2023 12:01:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvI07DeCeO6MJEHgN7uHUHdg4yTXp11mdXjrLHj6/IPeTToalt6WzDkMpopriWSnbnmiFg X-Received: by 2002:a05:6a20:918a:b0:159:c24f:5fa4 with SMTP id v10-20020a056a20918a00b00159c24f5fa4mr13547392pzd.1.1700078488947; Wed, 15 Nov 2023 12:01:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700078488; cv=none; d=google.com; s=arc-20160816; b=ZNxLu8Op28ZEZAE4ADH5qwXnx5YLK7dyig0lHZeNyNe3wZnwfIW2MI46B1fF47g6PB f0C46gmKdK478h55NsmKlTKsaWk2XXAUaX9ERi6df3feFfcl1RPltmxLAJdn3SrxKybo op1UPn06oWL65xiW4644l9qeBTm5s/RNtNms/xEpaBynJha4B34fB4JChbycUP+SWwXw ndMWxCgjHaFkVK20q/mPclNJvLNzuTRXq96n/tpWplvLKKZRUKomlNzEkaRgMzsGvtEe ieTMEUZPKMDnaf9lrogCoW+UV5o4ccdAdPaTg9MF9gaLrpKEIVL3NxFaqRoXm4yha5Xk gr1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=/WtY+J8lXaOp9y9U/jw1f+aWhLoHmgK6kwTtZyv8YJw=; fh=2hFjvaEPSeuRZmT5Oy5pixCnK56hZqRdDmTlKNMMEfc=; b=Voi57O2BS8pe4iZFpsok9VkSX/03RKa/O4G7EhfpmA5rXxIpli7+R3+DCwjReSJlg0 KPE3iFyX0dqkaiBV5iWTvQvvIU7HLb9xeyXfYYsrzqOteptOJwYVX9X+dleRAeJte3NZ qKPuJrBkS+GzWymzYfYkJXqGEXSjWlWbw1vUyBeISb1FYfP8cCxeOQdeNtvFN4sw3M4R vtRJErM3pQ2basWKIVWUHbnKNPOnYUPR2gZ/dwhuGVk67/j2V1UwP3LTWEkAY4mCuPzw B+t0tyuunKU6H8nJT34s+ihyMiJqHZMuMTUP4/4GBXmIPc7NlYa3swh9kptznoEXLkV/ PEog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nHnN7qk+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id a15-20020a056a000c8f00b006be55174f3fsi11138572pfv.28.2023.11.15.12.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 12:01:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nHnN7qk+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DC4198064CD9; Wed, 15 Nov 2023 12:00:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344114AbjKOUAb (ORCPT + 99 others); Wed, 15 Nov 2023 15:00:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344087AbjKOUA2 (ORCPT ); Wed, 15 Nov 2023 15:00:28 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2D2DB8; Wed, 15 Nov 2023 12:00:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700078425; x=1731614425; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xSL9O7OKfhn47lCIAHNJi6bJYd3MBeV1ItF7Yks3P7s=; b=nHnN7qk+AZottYhB1OsBP7OEiaY3e3oG09ypuRyrQjjJFZz1OKPJJItX GLc72J8zEi9atLVKOJk8L1J1PCdrxvv5lcPqejWl/Mr/0rgbo0OTpo7JQ IQuwVVn8oYhPi0HXWuV2rqPhxghJe5Vz22kLfPylSiAi+CV31eUy/w1cs CJenHEioY3mk6jS+yL0yErpxD43aBdPPrfr3thHHanTO3R6XImV/W8192 YYmNZv5qv2FBqS4uVy2cw2VY095GHYvGqWdu1xCfdJh+D7pBYVTLFVTkr pGbsCI1zzkwbvl6O3g1NWdmw2E76Nu+ysMZTLHVI4Mv5wwYPQzSy/fPjs A==; X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="455235706" X-IronPort-AV: E=Sophos;i="6.03,305,1694761200"; d="scan'208";a="455235706" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 12:00:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="758596162" X-IronPort-AV: E=Sophos;i="6.03,305,1694761200"; d="scan'208";a="758596162" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.24.100.114]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 12:00:24 -0800 Date: Wed, 15 Nov 2023 12:05:06 -0800 From: Jacob Pan To: Peter Zijlstra Cc: LKML , X86 Kernel , iommu@lists.linux.dev, Thomas Gleixner , Lu Baolu , kvm@vger.kernel.org, Dave Hansen , Joerg Roedel , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , Raj Ashok , "Tian, Kevin" , maz@kernel.org, seanjc@google.com, Robin Murphy , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH RFC 09/13] x86/irq: Install posted MSI notification handler Message-ID: <20231115120506.0571103d@jacob-builder> In-Reply-To: <20231115124221.GE3818@noisy.programming.kicks-ass.net> References: <20231112041643.2868316-1-jacob.jun.pan@linux.intel.com> <20231112041643.2868316-10-jacob.jun.pan@linux.intel.com> <20231115124221.GE3818@noisy.programming.kicks-ass.net> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 12:00:50 -0800 (PST) Hi Peter, On Wed, 15 Nov 2023 13:42:21 +0100, Peter Zijlstra wrote: > On Sat, Nov 11, 2023 at 08:16:39PM -0800, Jacob Pan wrote: > > > +static __always_inline inline void handle_pending_pir(struct pi_desc > > *pid, struct pt_regs *regs) +{ > > + int i, vec = FIRST_EXTERNAL_VECTOR; > > + u64 pir_copy[4]; > > + > > + /* > > + * Make a copy of PIR which contains IRQ pending bits for > > vectors, > > + * then invoke IRQ handlers for each pending vector. > > + * If any new interrupts were posted while we are processing, > > will > > + * do again before allowing new notifications. The idea is to > > + * minimize the number of the expensive notifications if IRQs > > come > > + * in a high frequency burst. > > + */ > > + for (i = 0; i < 4; i++) > > + pir_copy[i] = raw_atomic64_xchg((atomic64_t > > *)&pid->pir_l[i], 0); > > Might as well use arch_xchg() and save the atomic64_t casting. will do > > [...] Thanks, Jacob