Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10076237imu; Wed, 5 Dec 2018 15:48:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/WFV6fxVDxj19g2zyZ/OAzewt7kp6vdXK5NCSYHF7wFjoLlQZEYVAhHqv+1EOO+uXa9xuMv X-Received: by 2002:a63:a611:: with SMTP id t17mr21910824pge.338.1544053692408; Wed, 05 Dec 2018 15:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544053692; cv=none; d=google.com; s=arc-20160816; b=NYtMErvTtMUHZKT2tmi/yFqIWbAlfxpBZNUgBk5LKjoCHVpygvCm5F0q94Q/jMP8hI W06dKcjoYw9ofnpqyD/2ae2cwAVTEP+FIOYSvlQj/u5R0eGnlvWaThQOkEx4k/ZFXIRe 8urhvvchnWFdwbdNjRELJ7yDgVCmdV/xj8EvXU/dTghiuqr5QKtm4bpkgqu0dHWPm1bF 6405OruS5SaVqsPFEEhbmgieI12UaT17fR2mx0OnaUapKRGOA80HaSV3XbGPtRiKEheq /OLtwEiwScOEqkniGT8668SbkGvlX9zdo7RnPwNSjeDm9euTWL86Q0tYPPRZatl6kvzX pqlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fWzV0TwCi+VrMFQOjMoPoW7HFbXeLVttZD1Mne1mWk0=; b=NIAQ0WpVuln62mYX2RZFWwtJZjvvJi6y3pDIk9H9AbX7u/qYg2PZiaa++t38yg0Ifm A4a38Z9f28TAFuWHJqhN1zzfeEBGM0ig8Q1VOrC0Hev8cm2iB+atNbPIyT3ezL0G5sV9 n4WtKO1ZU87S/Qt43mUP15paEjfXhLOQxuV08tTyeV+2N6rFKGt4QiLJKalmjpOKts/Q GHPVfoTWPg8uXkgQroHmb743iJ6WkzjxQwukYQoKqfHCmAmJCyd1TNYVOFyOvDiYW7Z3 pf9rgayc/arekbcY1SsMtq8/Aeb7RCBxi3F8Nog2CofZZV7A/Oq2UDAvl5d+4NpM3bAR TzwQ== ARC-Authentication-Results: i=1; mx.google.com; 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 k11si18477585pgg.430.2018.12.05.15.47.57; Wed, 05 Dec 2018 15:48:12 -0800 (PST) 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; 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 S1728851AbeLEXqu (ORCPT + 99 others); Wed, 5 Dec 2018 18:46:50 -0500 Received: from dcvr.yhbt.net ([64.71.152.64]:53470 "EHLO dcvr.yhbt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbeLEXqt (ORCPT ); Wed, 5 Dec 2018 18:46:49 -0500 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2CDED211B3; Wed, 5 Dec 2018 23:46:49 +0000 (UTC) Date: Wed, 5 Dec 2018 23:46:49 +0000 From: Eric Wong To: Roman Penyaev Cc: Alexander Viro , "Paul E. McKenney" , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Desnoyers Subject: Re: [RFC PATCH 1/1] epoll: use rwlock in order to reduce ep_poll_callback() contention Message-ID: <20181205234649.ssvmv4ulwevgdla4@dcvr> References: <20181203110237.14787-1-rpenyaev@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181203110237.14787-1-rpenyaev@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Roman Penyaev wrote: > Hi all, > > The goal of this patch is to reduce contention of ep_poll_callback() which > can be called concurrently from different CPUs in case of high events > rates and many fds per epoll. Problem can be very well reproduced by > generating events (write to pipe or eventfd) from many threads, while > consumer thread does polling. In other words this patch increases the > bandwidth of events which can be delivered from sources to the poller by > adding poll items in a lockless way to the list. Hi Roman, I also tried to solve this problem many years ago with help of the well-tested-in-userspace wfcqueue from Mathieu's URCU. I was also looking to solve contention with parallel epoll_wait callers with this. AFAIK, it worked well; but needed the userspace tests from wfcqueue ported over to the kernel and more review. I didn't have enough computing power to show the real-world benefits or funding to continue: https://lore.kernel.org/lkml/?q=wfcqueue+d:..20130501 It might not be too much trouble for you to brush up the wait-free patches and test them against the rwlock implementation. (I only noticed this thread since I was catching up on some public-inbox work :>)