Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3936213pxf; Tue, 6 Apr 2021 04:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTJIli96gxJIEdWDekkp5jjKqaGtTUvmJYX1EmTuofsiNIObg/DWEhyhMRxQJJLZwzI7nT X-Received: by 2002:a17:906:5383:: with SMTP id g3mr33717414ejo.185.1617707600759; Tue, 06 Apr 2021 04:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617707600; cv=none; d=google.com; s=arc-20160816; b=FzbQRszxRPPU6Xe1Im+/SvqcpQM50cFNtJ04KoHrYPwDuK6Jcog+OIEMuDW/ha3hTH 5HlwTgRkCt3E8ZhGp1ZXLk5273xTT17jS0574mqHtisjlauOeniA/dWag++yl2BVSWGW okwQkQpZ0TK6IFyoQRYtCx3Lg3i9nNMrlUJV0409Cp3vGm4SnFtxzoDB9w26YWDbvu0w S6FZmVtHMElmlHZEnOwt4gCn0lypXxYroSCFCl632fQ6CDWmgp7+IH25029MYAOQ8X+n kK7UJ0brbM8GgOh88Jq7drD+OUl+JkrHbDoCiBGQZ34LfPh3YLSPKAUxhdvwfRmgvgP2 3QlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ife+98Xh/+nnz1tF6ZDCNqY1mNx4okJUp9RpwvKhMh8=; b=nxzIn2F85LLM9okryhTc9TOZWYlV1HEXJja0zbAj5XqEElibeL+30JoL9Qx1f7KTKA SOZzIjYcgUDebj4Unx2uXgJgczoXY5lvDGiSptn2VF73KNpaKXDhZr/eS/ds/7YuFqfr oM22JkghYXrdr9l2ElBqHtpJYdmwju1hkGlTqzXVFP/oZZ/Sl9ksIrVA2TLOsXJVUrb4 HD9UJqFO7VoF6MjDNsqV7WWMuyrwC2nklo3qWBBcGpVPQ7EkMsA0TxtC7ja4snwyaEhH /2bBM8KLtrF9DcewCTOi/VEHY3H1VxqZhnlKyQYS5BSRjJHFMYSHGHONH6zVvHBlVYIE lCEg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si14959678ejx.700.2021.04.06.04.12.57; Tue, 06 Apr 2021 04:13:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241498AbhDEXKx (ORCPT + 99 others); Mon, 5 Apr 2021 19:10:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:38394 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238555AbhDEXKq (ORCPT ); Mon, 5 Apr 2021 19:10:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 20343B115; Mon, 5 Apr 2021 23:10:38 +0000 (UTC) From: Davidlohr Bueso To: akpm@linux-foundation.org Cc: jbaron@akamai.com, rpenyaev@suse.de, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net, Davidlohr Bueso Subject: [PATCH 2/2] fs/epoll: restore waking from ep_done_scan() Date: Mon, 5 Apr 2021 16:10:25 -0700 Message-Id: <20210405231025.33829-3-dave@stgolabs.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210405231025.33829-1-dave@stgolabs.net> References: <20210405231025.33829-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 339ddb53d373 (fs/epoll: remove unnecessary wakeups of nested epoll) changed the userspace visible behavior of exclusive waiters blocked on a common epoll descriptor upon a single event becoming ready. Previously, all tasks doing epoll_wait would awake, and now only one is awoken, potentially causing missed wakeups on applications that rely on this behavior, such as Apache Qpid. While the aforementioned commit aims at having only a wakeup single path in ep_poll_callback (with the exceptions of epoll_ctl cases), we need to restore the wakeup in what was the old ep_scan_ready_list() such that the next thread can be awoken, in a cascading style, after the waker's corresponding ep_send_events(). Signed-off-by: Davidlohr Bueso --- fs/eventpoll.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 73138ea68342..1e596e1d0bba 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -657,6 +657,12 @@ static void ep_done_scan(struct eventpoll *ep, */ list_splice(txlist, &ep->rdllist); __pm_relax(ep->ws); + + if (!list_empty(&ep->rdllist)) { + if (waitqueue_active(&ep->wq)) + wake_up(&ep->wq); + } + write_unlock_irq(&ep->lock); } -- 2.26.2