Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1127102ybj; Tue, 5 May 2020 13:39:07 -0700 (PDT) X-Google-Smtp-Source: APiQypL41JyhQbZgRDg2zgMId62zkvc15lx7xfyCGBsAUD9hwFC7+gON6vrDKSgWClnkbnmudoWY X-Received: by 2002:a17:906:8282:: with SMTP id h2mr4689403ejx.250.1588711147113; Tue, 05 May 2020 13:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588711147; cv=none; d=google.com; s=arc-20160816; b=O92DrrWhEDrYrKruvZ4vvKUEQg9tHfstYDrxS8KZjy6U1/zq2fYhrhXspW1nUS7gKC jPYXS48Rm7cXxwBRNY6bcJG6bDFReRk7B3osY4FH9gyEVQaMetB6Rdl8gA5HbsmAcMpI 370Vgg/0WV2YwWd7qlbKRX6kTkVow8Utp03238gefPzpOuMRq//AnX2v799b5Sn/LNcE fC3VW3GPAD/gthvR1CXykTzskdg86i1Hh8UzGYc/m+puVOXDa/VVkL8i8fZWjlyDt624 rX2GdEU6b5+dXsmav37fGr+2qarDytvgAOSySh5xUtm0p0gJXV8TtQ2z22FO/yA44tvw 6EvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XEAq1qR7c6+ra3RdnbMtrjFGoO4ipOXO+A1Su5NP3KU=; b=TUKjN0OsJ+qT14gI4VM3k9c36C4SQkg5RaSVaFORPuHzuvQtLOrIOsGQRBoDj6lszb 6h9UYqOEL8u2Hb6HU0+m2zXeHV7sh52J4qHjtH4YBiLt8/DUsI+Ia9ClckfVd1WJeWL5 lPY4lpMk2pEJjXJrTSt8Rrc0jUvT+lKwVpKyUO0Q6+1NRYZ+C0WSHSFDdd1fttI1f6qH fdekaMaIXq/qWxS3byQi2MxB5ZnEWb/A3UnvbvHVF5WZg/oJ6NXkTPEEG5Uy7dv4UoOY W1djOtLGT6DeM3dkk6jJaQfLwJLzM8RckQnIumja8WfPEKISo+SFkPDL3+7ciEvwFOcK DqCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Mjtr6v62; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si1757546edq.123.2020.05.05.13.38.42; Tue, 05 May 2020 13:39:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Mjtr6v62; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729196AbgEEUft (ORCPT + 99 others); Tue, 5 May 2020 16:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729189AbgEEUfs (ORCPT ); Tue, 5 May 2020 16:35:48 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09DA3C061A41 for ; Tue, 5 May 2020 13:35:47 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id j2so2936143qtr.12 for ; Tue, 05 May 2020 13:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XEAq1qR7c6+ra3RdnbMtrjFGoO4ipOXO+A1Su5NP3KU=; b=Mjtr6v624mwd+SkOqVanfa/Hmx2bM3zl8sFu15lvU6VJfAsYh3yx4ASR9yL9R2iG9G pZ0TbpokKYqWaTDRcRQ4jfBhiEXVN87QcoLHfbbgizy1+qDCGZItP2yfMwu4WPteJGLW cLxg9i5A+k5KGilQV9Ptl1g9EapQ7KYK9Mdcb6LmicnB/CyMKWIUPglmXeEkwrwuW6vd GLk5shmmjjs8kKxnMYzAzbR66ZBlU07l4B2HT4e7tbQJMwRkj0w33h0REgMtsH2P7Bz0 pLKIytVpecHNSGhdcsJK492RjFMYN3q/DTT4I0Anen6oyeq4BEpP/4aI4X9hSNgWK7or 1GrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XEAq1qR7c6+ra3RdnbMtrjFGoO4ipOXO+A1Su5NP3KU=; b=a/2qjzrwO5VWw+tTFlXELaoZ6YlbgkGR1lOJ9HVVzD94nqFrXJo4HIiqeLZlBMjI7g FNgwbTkGM3qWqmE2evX70nXKkKur4G4Hlrhk44JJZrlmXm11/0R1P3yFSPrRmulXJU9y ygCp8Z8hQ7nOO++y8sq7HBqyl8p2GSSkJiPXRtcHW4fD3rdrOEaTTl54t7UaSuf4NVPH 2i4fxmzef8J1XVr68samKCqNZwM8mlVXVj60vfyHThLdMAv0LeXmKlaL0Cc5ND3GXyIl 6tA8pUgnxfPvbbqW8w29MzrA2EAerqdlj6oglpg5faR4ZXWyLGUx5qSVZU+IEHGHhVWM pWBQ== X-Gm-Message-State: AGi0PuaOqCDlj+I1rgXgM6T8un1Y312L7DCRvCWZgANoVUYGiGzlRDmU 0H1D7pHBv8t4GReb9jmC0+GK3Q9k0DvjA8GxpwNdpA== X-Received: by 2002:ac8:3488:: with SMTP id w8mr4874608qtb.378.1588710945678; Tue, 05 May 2020 13:35:45 -0700 (PDT) MIME-Version: 1.0 References: <20200505084049.1779243-1-rpenyaev@suse.de> <20200505130357.04566dee5501c3787105376f@linux-foundation.org> In-Reply-To: <20200505130357.04566dee5501c3787105376f@linux-foundation.org> From: Khazhismel Kumykov Date: Tue, 5 May 2020 13:35:34 -0700 Message-ID: Subject: Re: [PATCH 1/1] epoll: call final ep_events_available() check under the lock To: Andrew Morton Cc: Roman Penyaev , Jason Baron , Alexander Viro , linux-fsdevel , Linux Kernel Mailing List , stable@vger.kernel.org Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000009b8b1e05a4ec97e5" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000009b8b1e05a4ec97e5 Content-Type: text/plain; charset="UTF-8" On Tue, May 5, 2020 at 1:04 PM Andrew Morton wrote: > > On Tue, 05 May 2020 10:42:05 +0200 Roman Penyaev wrote: > > > May I ask you to remove "epoll: ensure ep_poll() doesn't miss wakeup > > events" from your -mm queue? Jason lately found out that the patch > > does not fully solve the problem and this one patch is a second > > attempt to do things correctly in a different way (namely to do > > the final check under the lock). Previous changes are not needed. > > Where do we stand with Khazhismel's "eventpoll: fix missing wakeup for > ovflist in ep_poll_callback"? > > http://lkml.kernel.org/r/20200424190039.192373-1-khazhy@google.com > My understanding is - we need the ep_poll_callback fix on a logical level (ovfllist was never triggering wakeup), and the two follow-ups close races - in both how we add/remove from the wait queue, and how we observe the ready list, which are needed if we only wake when we add events, where before we were also waking when we were splicing ovflist events when reading the ready list. As well, the first two together are needed for epoll60 to pass in my testing. Khazhy --0000000000009b8b1e05a4ec97e5 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPBgYJKoZIhvcNAQcCoIIO9zCCDvMCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9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