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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24A4DC4332F for ; Thu, 13 Oct 2022 13:37:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229545AbiJMNhz (ORCPT ); Thu, 13 Oct 2022 09:37:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbiJMNhx (ORCPT ); Thu, 13 Oct 2022 09:37:53 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E84AA5143F; Thu, 13 Oct 2022 06:37:51 -0700 (PDT) Received: from zn.tnic (p200300ea9733e733329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e733:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1DB8C1EC054C; Thu, 13 Oct 2022 15:37:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1665668266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=EmYBLVOiMUuM+RODYtYXcffudc/+Ogx/DDE0gYCil7U=; b=OZUMz+OxHh+lwtAeniW1/rexhDd7+lG+ovqcaYcrkDTFT04h1cESWqeeg3thaNhiGLIGtD JsisTkujOaQQTE6wtJCyxLdAsP/PE4nGhCB3pNuPGQgKxei5++Nf6fW8Jy6m9U5jmm7guf U2pmYireE6tvSKMYuKu0KXPvDsvceok= Date: Thu, 13 Oct 2022 15:37:42 +0200 From: Borislav Petkov To: Justin He Cc: Len Brown , James Morse , Tony Luck , Mauro Carvalho Chehab , Robert Richter , Robert Moore , Qiuxu Zhuo , Yazen Ghannam , Jan Luebbe , Khuong Dinh , Kani Toshi , Ard Biesheuvel , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" , "devel@acpica.org" , "Rafael J . Wysocki" , Shuai Xue , Jarkko Sakkinen , "linux-efi@vger.kernel.org" , nd , kernel test robot Subject: Re: [PATCH v8 6/7] apei/ghes: Use unrcu_pointer for cmpxchg Message-ID: References: <20221010023559.69655-1-justin.he@arm.com> <20221010023559.69655-7-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Wed, Oct 12, 2022 at 12:04:57PM +0000, Justin He wrote: > I have a concern about what if cmpxchg failed? Do we have to still > guarantee the ordering since cmpxchg will not imply a smp_mb if it > failed. Of course it will imply that. At least on x86 it does. smp_wmb() is a compiler barrier there and cmpxchg() already has that barrier semantics by clobbering "memory". I'm pretty sure you should have the same thing on ARM. And even if that weren't the case, the write barrier is, as the comment says, "new_cache must be put into array after its contents are written". Are we writing anything into the cache if cmpxchg fails? > Besides, I didn't find the paired smp_mb or smp_rmb for this smp_wmb. Why would there be pairs? I don't understand that statement here. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette