Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1612741ybb; Sun, 29 Mar 2020 09:02:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt3VoCGgSTg64/xop/k8DAUyERycxgHNkhAIuSPbvZo8mgrlnT+UMU99xKXGhRl7VrSjT7b X-Received: by 2002:aca:3ad7:: with SMTP id h206mr4817908oia.169.1585497741546; Sun, 29 Mar 2020 09:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585497741; cv=none; d=google.com; s=arc-20160816; b=o6wlXg+mXNGSuNuJSpGPMBhS8yCJ4jiYoO8ZUWXHlJqSi+USJyyqHejj89OvcbLzEc I+xyBa/WYXdWZURWcBg5MY62+78U4JsIhypf6t6dmRkCEEhSjvkLotocY1dITBEXq+Ck H/qM7kN0MkMuyClQozw61pqCncZU2+Bo0qrzOEnr2y9juN6TVjyRXMwNkmmhqPWPeWXZ 8mtdF8IjJ0RljaKXwRWyoa2+Sv665zKRbQOJUrCgWlrIVd+RzCUBGQxxce2foVe9naS5 KnXK1nz5ncK5gplSWNnzHP7nW0NQJf+eTSJrjGijz+X9NLkrMECpnj+GX9uPFh5846At EehA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=pCwJdZ4oYpHCHMibmOReVF7N6gE+KCAvIUWmyMKKDe4=; b=z3Mf5aygdpCKI9HWYenCES4dzBCHn+MC38HIfDkNK5USyX8IJ8m/PCMTtlYHsXjuWR CTPLXqv4cpw3TcrCDYTsGfVk0NhtvAkn5GcoQ8rMUEcatCHd8like+zUzwX5wnzmjR/W YALpmeOazOYBtSmHH2bl2zH6W8fu3ysiTCWsyUuh9jRoty3Abc0HvBbPSDa/ObETZr/g Mh9t1YWfFGE06UegXXXgFuNxBgckRIAyPTiU6TNt1od3PIPYXs94vbdIhCRGCN3Sb6Mk diaKesJD+d1R7cIgZS33d/Z9Bjtpnz7XQC8Q0ECbzmG3Ed65n0eDIzfEDaw+Qg+nq1q9 Xpkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Biyyy2e6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si5079656oth.209.2020.03.29.09.01.56; Sun, 29 Mar 2020 09:02:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Biyyy2e6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728292AbgC2PzP (ORCPT + 99 others); Sun, 29 Mar 2020 11:55:15 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47604 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727167AbgC2PzP (ORCPT ); Sun, 29 Mar 2020 11:55:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=pCwJdZ4oYpHCHMibmOReVF7N6gE+KCAvIUWmyMKKDe4=; b=Biyyy2e6QDZHit2SaG/SI/h2i8 JiXmMVOgEmVgajT3SKlXid6Nu93gzv87MQ8nFzhn0kFJWUCytKNeQihL6Eo49Ib5bwsdZkNCpmR8d ojYkju1VZgzgq2FouODPi5LIKgzPxmYboWX4wJkcJkTVyVNzPod0vPXfDzJo/jmwal0FnqdjN/uyF B0lIl3+lL9oMA2D85lcp/BG/15yQI22QLiVwBiD4usQSJ+xqbYOt7w4Vusk1Yo/yqIvEkE7/GU1uG aN13HSOHk/EhoESRMQufJnzbzKBineK9zqBfQfyQuoTqzoLp0c8ido5bRy/5Hz29NCXRoK2Jt1lzU KC6Lspiw==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jIaHJ-0004FD-M2; Sun, 29 Mar 2020 15:55:13 +0000 Subject: Re: Weird issue with epoll and kernel >= 5.0 To: David Laight , Omar Kilani , "linux-kernel@vger.kernel.org" Cc: Davidlohr Bueso References: <34206eb5-1280-4aac-9a50-76f967646ca1@infradead.org> From: Randy Dunlap Message-ID: Date: Sun, 29 Mar 2020 08:55:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/29/20 5:09 AM, David Laight wrote: > From: Randy Dunlap >> Sent: 28 March 2020 19:22 > ... >> There have been around 10 changes in fs/eventpoll.c since v5.0 was >> released in March, 2019, so it would be helpful if you could test >> the latest mainline kernel to see if the problem is still present. > > Is there any info about the scenarios that the fixes affect? > We've an application that can use epoll() or poll() and I wonder > if I should not default to epoll() on 5.0+ kernels that might be dodgy. 5.0 was released on 2019-03-03. The following patches have been merged since then. > git log --oneline fs/eventpoll.c | more ### latest patches first 1b53734bd0b2 epoll: fix possible lost wakeup on epoll_ctl() path 39220e8d4a2a eventpoll: support non-blocking do_epoll_ctl() calls 58e41a44c488 eventpoll: abstract out epoll_ctl() handler 339ddb53d373 fs/epoll: remove unnecessary wakeups of nested epoll f6520c520842 epoll: simplify ep_poll_safewake() for CONFIG_DEBUG_LOCK_ALLOC c8377adfa781 PM / wakeup: Show wakeup sources stats in sysfs eec4844fae7c proc/sysctl: add shared variables for range check b772434be089 signal: simplify set_user_sigmask/restore_user_sigmask 97abc889ee29 signal: remove the wrong signal_pending() check in restore_user_sigmask() 2874c5fd2842 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 a218cc491420 epoll: use rwlock in order to reduce ep_poll_callback() contention c3e320b61581 epoll: unify awaking of wakeup source on ep_poll_callback() path c141175d011f epoll: make sure all elements in ready list are in FIFO order > It rather depends whether wakeups just get lost - but the next > rx data will wake things up, or whether the linked lists get > completely hosed and 'all hell' breaks out (or doesn't). > > In our case there is only one reader and the fd are all > UDP sockets (added and removed when the socket is created/closed). -- ~Randy