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 E75A4C12002 for ; Wed, 21 Jul 2021 13:50:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D69F61019 for ; Wed, 21 Jul 2021 13:50:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D69F61019 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7BD26B0033; Wed, 21 Jul 2021 09:50:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E05036B0072; Wed, 21 Jul 2021 09:50:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCDE66B0073; Wed, 21 Jul 2021 09:50:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id AEEA76B0033 for ; Wed, 21 Jul 2021 09:50:34 -0400 (EDT) Received: from forelay.prod.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by fograve01.hostedemail.com (Postfix) with ESMTP id 656DA1856A1E0 for ; Wed, 21 Jul 2021 10:11:34 +0000 (UTC) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 123D01856C049 for ; Wed, 21 Jul 2021 10:11:34 +0000 (UTC) X-FDA: 78386178108.22.6749EAB Received: from mail3-165.sinamail.sina.com.cn (mail3-165.sinamail.sina.com.cn [202.108.3.165]) by imf18.hostedemail.com (Postfix) with SMTP id 140A64001884 for ; Wed, 21 Jul 2021 10:11:31 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([39.155.215.62]) by sina.com (172.16.97.32) with ESMTP id 60F7F2CD0001E458; Wed, 21 Jul 2021 18:11:27 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 718925628906 From: Hillf Danton To: Thomas Gleixner Cc: Hillf Danton , Paolo Bonzini , 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: Wed, 21 Jul 2021 18:11:19 +0800 Message-Id: <20210721101119.1103-1-hdanton@sina.com> In-Reply-To: <87im14cemr.ffs@nanos.tec.linutronix.de> 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> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 140A64001884 X-Stat-Signature: igp8i6mxq989zdemsy1h8orkg1jgrrg1 Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.165 as permitted sender) smtp.mailfrom=hdanton@sina.com X-HE-Tag: 1626862291-467804 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.010923, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 21 Jul 2021 09:25:32 +0200 Thomas Gleixner wrote: >On Wed, Jul 21 2021 at 15:04, Hillf Danton wrote: >> >> But the preempting waker can not make sense without the waiter who is = bloody >> special. Why is it so in the first place? Or it is not at all but the = race >> existing from Monday to Friday. > >See the large comment in eventfd_poll(). Is it likely for a reader to make eventfd_poll() return 0? read * poll write ---- * ----------------- ------------ * count =3D ctx->count (INVALID!) * lock ctx->qwh.lock * ctx->count +=3D n * **waitqueue_active is false** * **no wake_up_locked_poll!** * unlock ctx->qwh.lock lock ctx->qwh.lock *cnt =3D (ctx->flags & EFD_SEMAPHORE) ? 1 : ctx->count; ctx->count -=3D *cnt; **waitqueue_active is false** unlock ctx->qwh.lock * lock ctx->wqh.lock (in poll_wait) * __add_wait_queue * unlock ctx->wqh.lock * eventfd_poll returns 0 */ count =3D READ_ONCE(ctx->count);