Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4012994pxf; Tue, 6 Apr 2021 06:06:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7gw4JT2R/KjnsVpe8VQmVJ+ovU1I+tNYiWTLZubkTwhcYsTFHNht/q0GQAVoLaZNIZXs8 X-Received: by 2002:a02:c017:: with SMTP id y23mr29141007jai.3.1617714361845; Tue, 06 Apr 2021 06:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617714361; cv=none; d=google.com; s=arc-20160816; b=WiJkZSNq16Ww418eoW2cIUkQG9THjH9e+ku82ZCrkm1qzimyS+2npE0e5hhWtvQM3A HEeNjQ6DflJm5apD+MeMcPrEce4wazMXMNnc9gLLbHk6vbdobQlNc9sKJimRZFwNgaF0 wZRcMujiC05hGNKxhCWh6s3ViozBEWHcj2HEf8zqkB0rHWlZsp17m51LN8iS4E1862Gv RG1p+G6OSHq3ChpNnjXaQSFs9Vne+eVBaBx2XkfV5Ua6ubE4PXQX1k4IoBxCOE/0lQOe BBGSTbd/MKmAvAdIUzRE1T6hvm1GoEKloHElLVWJYAAlYxWqt7KQV+9E3RTefKGqhB2l b3rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=LmFMfCGC9wRvs5HsVIhPdFCOm/LukgaloP76bi8VHdY=; b=CeuVVQLjSJxFNqOz1Lid1VWK/APLLhyA7YMKqPfSWC2gLqUfQF6qqvP61Y5ahJ74s8 UHqndKxFosewW+Uu0RnroHsQtrI8kNTyDj4t832uz/HJ9uZCclIulzr9zQeX8xDuakNT DdGkQMcRe/Miy12YdmJ0sQegIG5EGUKnZ+lhdSxBfvvbrpSvUGHMGSeJyqOz9e3XNQUb c0wqa81OA/x3vpAyur+/d4quv4kSGX2LOjTPmj6MtqSWNsah5ORUMhB1u+hSbLhJzYJA RYibpi3lHwprcQzgQ5CmDmvScCDHPfCMgL7h0WgxxySeaiWOfUunPQGjsIwPG+xuoTF4 XPoQ== 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 z8si19179780ilq.38.2021.04.06.06.05.48; Tue, 06 Apr 2021 06:06:01 -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 S238396AbhDFDWn (ORCPT + 99 others); Mon, 5 Apr 2021 23:22:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:40992 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbhDFDWm (ORCPT ); Mon, 5 Apr 2021 23:22:42 -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 D8B77AFF7; Tue, 6 Apr 2021 03:22:33 +0000 (UTC) Date: Mon, 5 Apr 2021 20:22:26 -0700 From: Davidlohr Bueso To: Andrew Morton Cc: jbaron@akamai.com, rpenyaev@suse.de, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 2/2] fs/epoll: restore waking from ep_done_scan() Message-ID: <20210406032226.2fpfzrlyxu2wz2jw@offworld> References: <20210405231025.33829-1-dave@stgolabs.net> <20210405231025.33829-3-dave@stgolabs.net> <20210405185018.40d437d392863f743131fcda@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210405185018.40d437d392863f743131fcda@linux-foundation.org> User-Agent: NeoMutt/20201120 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 05 Apr 2021, Andrew Morton wrote: >Tricky. 339ddb53d373 was merged in December 2019. So do we backport >this fix? Could any userspace code be depending upon the >post-339ddb53d373 behavior? As with previous trouble caused by this commit, I vote for restoring the behavior backporting the fix, basically the equivalent of adding (which was my intention): Fixes: 339ddb53d373 ("fs/epoll: remove unnecessary wakeups of nested epoll") > >Or do we just leave the post-339ddb53d373 code as-is? Presumably the >issue is very rarely encountered, and changeing it back has its own >risks. While I also consider this scenario rare (normally new ready events can become ready and trigger new wakeups), I'm seeing reports in real applications of task hangs due to this change of semantics. Alternatively, users can update their code to timeout in such scenarios, but it is ultimately the kernel's fault. Furthermore it hasn't really been all _that_ long since the commit was merged, so I don't think it merits a change in behavior. As for the risks of restoring the behavior, afaict this only fixed a double wakeup in an obscure nested epoll scenario, so I'm not too worried there sacrificing performance for functionality. That said, there are fixes, for example 65759097d80 (epoll: call final ep_events_available() check under the lock) that would perhaps be rendered unnecessary. Thanks, Davidlohr