Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10260183imu; Wed, 5 Dec 2018 20:05:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/XWXqCJULZ3WrBcd22yvtMHR891FORhRqOREHaet5KOAdfd6RyNBegp5aHx7SQ5OHMWju1S X-Received: by 2002:a62:2292:: with SMTP id p18mr7207688pfj.9.1544069145579; Wed, 05 Dec 2018 20:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544069145; cv=none; d=google.com; s=arc-20160816; b=P/8ja9SnkG68fPuGs8HTkAEjjPkp+9yDDne4Klo1omD6qkQGf1pG1bHna5EoUlu8cA 00YuOmKLvofLOspx8lsZ//7aJHs9J2nQHgwXIBL22SRYfl1axA7+LZj4Eh9VSBwJ/14z N3SCZWOtXVm8vazRKWPthuDpxLMhU8HQbv5dVppLVYlhJZkjd8pFuXA78jV94vuYladF R8vHaBu5w6gBFBtvfFray2nXHvZgxQZpZ8+mcShwXrRQsCxix62HQs0+puUwAO/F7hhb IQtxZPNgy27k+DdfSJt0wJWgJw1UFAQimBzuc3Po2mvvsfaXgf6APeVx7dE+r9YyFaiP hOcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VvxTA0AIF+ve2qTJwrr9mYut8M+r18B0HQHcMWCv8Qw=; b=TmA7dX6oh6E1Q+6S/gdSjuHABH3nvmDU9Ni4AZ/VJqainpBn1tJX37q3Fm7NktcFJd n5cDflKTh0Nzpqys9WWJOcUleAzuzWA8wdNxO3pvk/4eCdOboRghDa0vn4q2UD/tIqYw CL1lzs4YOPapwm5NKw3/DTGbkt5+hECWIHVSoN2sqXfJGIIy6mqzUO8Bh61fsKEJeGDD p/PYjkbzwzJtqYLcoN9XrKxgv84wm7W081ot3kGyZIi9RS3OprPRWEi7m2jvU9/ZR7U5 38wRR44nCeb7RO8lG/FrEcliSl5JIn1Gfi1L3Qvg5zxSaHdCu4au72+1DGDRb/1ufaNS aJIw== 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 d10si21292526pls.170.2018.12.05.20.05.24; Wed, 05 Dec 2018 20:05:45 -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 S1728894AbeLFEEi (ORCPT + 99 others); Wed, 5 Dec 2018 23:04:38 -0500 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 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B8F60AE7A; Thu, 6 Dec 2018 04:04:36 +0000 (UTC) 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> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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