Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp5864624ybx; Sun, 10 Nov 2019 23:22:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxSHfI5uFAW2XcT4dXnDHn1+h9MpPT/luoV7lD6Q9k+DlkT3m7TZZchxUSkgOsyP6yb10dJ X-Received: by 2002:a17:906:6a8e:: with SMTP id p14mr21393433ejr.137.1573456925606; Sun, 10 Nov 2019 23:22:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573456925; cv=none; d=google.com; s=arc-20160816; b=L2rGpWqY6aD2iWPk0qmVnZ66rFrlIxhlu6Ze95RH+OobOej0QfhVxVLT+5gtLnrbmI duODmrDTSNRmymWrdKg8t2zHBL4Kwtgn3ZqlXeAdPUReDFjEJAxsxSl/yXa8GDQSx4R2 VyK7PtmI1MVZw6B4C2xIxeurdPOZJblr1leSw9WBL/XxGZvNGE+ct4/QP1Uh9wUSRF/B bk6IeYpWWxTRpe3KTbG+t5Vsh4tNvxtdskNW+ubQhA3aSe505n5rJ8tP2qL+YG1jiGDa fX7bPriN06WtrQesWmRIdUnd4T1ZGgwpIuewywbr4d7XLY/WxjcYCbxcwdodfr9KA2WL DjPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rolDzRNdmch+TJjOcq+3SrTl4ASUgxQj4KW8In9RS18=; b=DfH4ADIAr8OoUB7JMidWqNZNpFonD39KMB6T4GE0qv/I3cPEALl1O/PzzSqTHhfce5 ZcXyhzDuqGNKO4rem2WOI7YWMD0l0jINSvTuiVrGKREJZFiXuL+7HsV0YmR5e7v0584E AEXdOG5pgWCeH6TtRnC83d4GCdYrqOFGvDVoxNaCmFmZlopiT9s5uwrh8slMoAPq96VY pnGola+//EIzHQipjg/tkUCuwEPa04mh8LRqe0Yxi1Dke6E8C70QfcySsCAKb18dUzfM HaUSreFcK1ktzG8Mw2Yw+j55QtDC9gN4o18p6ebHSFlAMBBVTf9iaT7bfpTChhSiVLy4 2oBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Olq79RDu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si9125189eje.376.2019.11.10.23.21.42; Sun, 10 Nov 2019 23:22:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Olq79RDu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726928AbfKKHUK (ORCPT + 99 others); Mon, 11 Nov 2019 02:20:10 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40097 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfKKHUK (ORCPT ); Mon, 11 Nov 2019 02:20:10 -0500 Received: by mail-wm1-f67.google.com with SMTP id f3so12056001wmc.5 for ; Sun, 10 Nov 2019 23:20:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rolDzRNdmch+TJjOcq+3SrTl4ASUgxQj4KW8In9RS18=; b=Olq79RDuRWkPl2xCzG3S1c3OoCBjaeMVgeZEdzN8RnE3oY4ZGi8+6lJ2dcgdGzT0AT VueNBI4qcksxr3neqW/7s1MrYT/r6crRBJb4lgWx9F0nffQNnKpfDkoS025pTsTa/3aD Pqhyf9zS0VUw9WZnnbS2bKCBUiya0nhIPd4oUpymJlfMARHn6AouTOIQJJ4k2xy9irbl SgRSKtJNNcO+3Dr5yGJFzz0bTECki7qIl4IHowSUvm9EBB3rYKsJLqoG4AIoXZe/dbte r4NdPd2w7tJhxEvESXA3wM9rHY58RTT5FtB6fmUbJQ4cmrW/z2wfIxavRT0yx5MzdWyj m/Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=rolDzRNdmch+TJjOcq+3SrTl4ASUgxQj4KW8In9RS18=; b=Cl9CZAmBw/U2ZUoDwc50Qdts9eAyMTzwbozqpZPe77YWMYxbZ7IwBbFZhc0kYxzPvW TyPnRYtgx8GMioUAPTbC8eEaJ5VlapE+rUYkhv9dvInyD8pfNQ6fPXwRax603xsxXSva jhZCiuUHrnTbxWGEcDOgZMtAwE5hBn3vy98Ie5nma58WU1vyRN9IlIpZWxh4oloI9Exi HvUnYue4MTWlMRLnNcunHVEDZ6NUud1ITQ+MUr6ThqiqNfbpiTgT+zwGya6viVqKYp+P ZkR8ZMYdl4wshgPBM8BVRvbYlfmHW2PcVjO9Tzlf0MOjHKGb+k9k00FvFaLzJu6CjmIb 0Ucw== X-Gm-Message-State: APjAAAU3xKkUXUIK/DB/p4JrarHSn9kk5LABQGZjAy56RZyQXFIFWDJe m1wHjnJAAHFNofdWfx6SKZk= X-Received: by 2002:a1c:9c54:: with SMTP id f81mr8334636wme.89.1573456808198; Sun, 10 Nov 2019 23:20:08 -0800 (PST) Received: from gmail.com (54033286.catv.pool.telekom.hu. [84.3.50.134]) by smtp.gmail.com with ESMTPSA id u16sm14843906wrr.65.2019.11.10.23.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Nov 2019 23:20:07 -0800 (PST) Date: Mon, 11 Nov 2019 08:20:05 +0100 From: Ingo Molnar To: Frederic Weisbecker Cc: Peter Zijlstra , LKML , "Paul E . McKenney" , Thomas Gleixner Subject: Re: [PATCH 2/4] irq_work: Fix irq_work_claim() ordering Message-ID: <20191111072005.GA112047@gmail.com> References: <20191108160858.31665-1-frederic@kernel.org> <20191108160858.31665-3-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108160858.31665-3-frederic@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Frederic Weisbecker wrote: > When irq_work_claim() finds IRQ_WORK_PENDING flag already set, we just > return and don't raise a new IPI. We expect the destination to see > and handle our latest updades thanks to the pairing atomic_xchg() > in irq_work_run_list(). > > But cmpxchg() doesn't guarantee a full memory barrier upon failure. So > it's possible that the destination misses our latest updates. > > So use atomic_fetch_or() instead that is unconditionally fully ordered > and also performs exactly what we want here and simplify the code. Just curious, how was this bug found - in the wild, or via code review? Thanks, Ingo