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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54C80C4338F for ; Sat, 24 Jul 2021 04:33:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 80C9660EB0 for ; Sat, 24 Jul 2021 04:33:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 80C9660EB0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C265B6B0033; Sat, 24 Jul 2021 00:33:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD5356B005D; Sat, 24 Jul 2021 00:33:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC3C96B006C; Sat, 24 Jul 2021 00:33:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id 90A936B0033 for ; Sat, 24 Jul 2021 00:33:40 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1DFCC25F28 for ; Sat, 24 Jul 2021 04:33:35 +0000 (UTC) X-FDA: 78396212790.16.67F0D9F Received: from r3-19.sinamail.sina.com.cn (r3-19.sinamail.sina.com.cn [202.108.3.19]) by imf18.hostedemail.com (Postfix) with SMTP id 70C3A405029D for ; Sat, 24 Jul 2021 04:33:33 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([222.130.245.194]) by sina.com (172.16.97.35) with ESMTP id 60FB981600026741; Sat, 24 Jul 2021 12:33:30 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 65352815073488 From: Hillf Danton To: Paolo Bonzini Cc: Hillf Danton , Thomas Gleixner , Sebastian Andrzej Siewior , "Michael S. Tsirkin" , linux-mm@kvack.org, LKML , Al Viro Subject: Re: 5.13-rt1 + KVM = WARNING: at fs/eventfd.c:74 eventfd_signal() Date: Sat, 24 Jul 2021 12:33:20 +0800 Message-Id: <20210724043320.1654-1-hdanton@sina.com> In-Reply-To: <41e2046f-ebbb-9fb2-3b30-1d6edceaaced@redhat.com> References: <8dfc0ee9-b97a-8ca8-d057-31c8cad3f5b6@redhat.com> <475f84e2-78ee-1a24-ef57-b16c1f2651ed@redhat.com> <20210715102249.2205-1-hdanton@sina.com> <20210716020611.2288-1-hdanton@sina.com> <20210716075539.2376-1-hdanton@sina.com> <20210716093725.2438-1-hdanton@sina.com> <20210718124219.1521-1-hdanton@sina.com> <20210721070452.1008-1-hdanton@sina.com> <20210721101119.1103-1-hdanton@sina.com> <20210723022356.1301-1-hdanton@sina.com> <20210723094830.1375-1-hdanton@sina.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 70C3A405029D Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.19 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none X-Stat-Signature: 5p1s3eq5xnay5g9pnt1hsudc1kanezi6 X-HE-Tag: 1627101213-647483 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000151, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 23 Jul 2021 12:56:15 +0200 Paolo Bonzini wrote: >On 23/07/21 11:48, Hillf Danton wrote: >> What the comment does not cover is the cases of more-than-two-party ra= ce. > >But, you still haven't explained what's the bug there. I am inclined to calling it race that has been there before and after the= big comment was added, instead of bug. CPU1 CPU2 CPU3 CPU4 ---- ---- ---- ---- lock WQ count +=3D n no waiter unlock WQ ------------------------------- c0 =3D count lock WQ ------------------------------- c2 =3D count add waiter for EPOLLIN unlock WQ lock WQ count =3D 0 wakeup EPOLLOUT unlock WQ lock WQ count +=3D n no waiter unlock WQ ------------------------------- c1 =3D count The c0 and c1 in the above chart are what I proposed, while c2 falls unde= r the range covered by the seep in the comment, * The read _can_ therefore seep into add_wait_queue's critical * section, but cannot move above it! add_wait_queue's spin_lock acts * as an acquire barrier and ensures that the read be ordered properly * against the writes. and is likely different to c1.