Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1158895imu; Thu, 13 Dec 2018 10:15:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/VonTXDpxipkI3iPZzxTaDxyPrvNnlxw73n4GWMVtUhIuu8C1FPAlmXOn5iAhDZxL/XNP4i X-Received: by 2002:a63:c303:: with SMTP id c3mr22698610pgd.268.1544724941777; Thu, 13 Dec 2018 10:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544724941; cv=none; d=google.com; s=arc-20160816; b=JrdOkXButwfWQUhAWBiH+9b0KZwP4VvfiuT89+LzQ20BwUfLAbDcjlPQcu01rLiUmf EmdbmpQKgPQZZGTJlCjf9T4VUDTzGvO7x41D+1dP1xYobAtb3JvVWmh46q0nCHVyMBpk Ns08isAomoERkQ6HMgs6fbYNZlk0rf4Tt3VW90dTFWaxTR90zVUen34WkKRjPxCeDdsq Y1B+0W3pBuqdZiQl9RYKrytCbNkLKrD+hRz2HrSyoRD+ED/P1r0Wyb6boULPjpgeLfrm QtsbWy/gbXgpfZ+i1ndEBqBQAOMUWWJAnCSHX7uEuudttlIyrRnj4KKn4eI362OdsmL4 TGFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:organization:subject:cc:to:from:date :content-transfer-encoding:mime-version; bh=wF0DmwYleK/iu4g1tlNqCBiHFBr+9uSyDaKf7rNWMlw=; b=SdNAxcaBrXzOhrhqV3k+oykD9Nvwni2qkW1iDigR41FBXgrZ8YZ9nzD78ncFYSQ95+ eAoJDmCVcmGtfdMqTHq7ZWkTeVW0HvlAWxh1bHu8aTNNvBISJbQ48DmQF7Pss3j2VP+4 Z9I/DeQnw2RpxE+7PhQW5Chhe5Qg7Pm1DJkHnGDuz3l5aUPGrmnHUR+Aj6upmBZmGTdt aW7uJsXVtH8O88EvDnhB7P29NuHK7/GMx3ZoZ8EM0wyf7Ew3PbXpakwyr+puaB14MtMi QtlzqQvc4Narh67NKwewzXYqK4jc3E5PHKuY4ZeTVDUNOmEKKS0KvrW2clfoOiHmUOp7 t4Fg== 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 j70si1916980pgd.138.2018.12.13.10.15.25; Thu, 13 Dec 2018 10:15:41 -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 S1729014AbeLMSNZ (ORCPT + 99 others); Thu, 13 Dec 2018 13:13:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:52986 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727511AbeLMSNZ (ORCPT ); Thu, 13 Dec 2018 13:13:25 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4E5CBAE28; Thu, 13 Dec 2018 18:13:23 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 13 Dec 2018 10:13:23 -0800 From: Davidlohr Bueso To: Roman Penyaev Cc: Jason Baron , Al Viro , "Paul E. McKenney" , Linus Torvalds , Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/3] use rwlock in order to reduce ep_poll_callback() contention Organization: SUSE Labs In-Reply-To: <20181212110357.25656-1-rpenyaev@suse.de> References: <20181212110357.25656-1-rpenyaev@suse.de> Message-ID: X-Sender: dbueso@suse.de User-Agent: Roundcube Webmail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-12-12 03:03, Roman Penyaev wrote: > The last patch targets the contention problem in ep_poll_callback(), > which > can be very well reproduced by generating events (write to pipe or > eventfd) > from many threads, while consumer thread does polling. > > The following are some microbenchmark results based on the test [1] > which > starts threads which generate N events each. The test ends when all > events > are successfully fetched by the poller thread: > > spinlock > ======== > > threads events/ms run-time ms > 8 6402 12495 > 16 7045 22709 > 32 7395 43268 > > rwlock + xchg > ============= > > threads events/ms run-time ms > 8 10038 7969 > 16 12178 13138 > 32 13223 24199 > > > According to the results bandwidth of delivered events is significantly > increased, thus execution time is reduced. > > This series is based on linux-next/akpm and differs from RFC in that > additional cleanup patches and explicit comments have been added. > > [1] https://github.com/rouming/test-tools/blob/master/stress-epoll.c Care to "port" this to 'perf bench epoll', in linux-next? I've been trying to unify into perf bench the whole epoll performance testcases kernel developers can use when making changes and it would be useful. I ran these patches on the 'wait' workload which is a epoll_wait(2) stresser. On a 40-core IvyBridge it shows good performance improvements for increasing number of file descriptors each of the 40 threads deals with: 64 fds: +20% 512 fds: +30% 1024 fds: +50% (Yes these are pretty raw measurements ops/sec). Unlike your benchmark, though, there is only single writer thread, and therefore is less ideal to measure optimizations when IO becomes available. Hence it would be nice to also have this. Thanks, Davidlohr