From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:41818 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727695AbeLFEEi (ORCPT ); Wed, 5 Dec 2018 23:04:38 -0500 Date: Wed, 5 Dec 2018 20:04:30 -0800 From: Davidlohr Bueso To: Jason Baron Cc: Roman Penyaev , Alexander Viro , "Paul E. McKenney" , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [RFC PATCH 1/1] epoll: use rwlock in order to reduce ep_poll_callback() contention Message-ID: <20181206040430.d7wjik6lt7kr75m6@linux-r8p5> References: <20181203110237.14787-1-rpenyaev@suse.de> <45bce871-edfd-c402-acde-2e57e80cc522@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <45bce871-edfd-c402-acde-2e57e80cc522@akamai.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 12/3/18 6:02 AM, Roman Penyaev wrote: > The main change is in replacement of the spinlock with a rwlock, which is > taken on read in ep_poll_callback(), and then by adding poll items to the > tail of the list using xchg atomic instruction. Write lock is taken > everywhere else in order to stop list modifications and guarantee that list > updates are fully completed (I assume that write side of a rwlock does not > starve, it seems qrwlock implementation has these guarantees). Its good then that Will recently ported qrwlocks to arm64, which iirc had a bad case of writer starvation. In general, qrwlock will maintain reader to writer ratios of acquisitions fairly well, but will favor readers over writers in scenarios where when too many tasks (more than ncpus). Thanks, Davidlohr