Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3901938ybi; Mon, 3 Jun 2019 02:11:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4Epexgw67INC0I+/nupNDtOm5AfuvRcBS+tqDnltTP0fjcXRT6/lD3g5nWZowoEkIiU7P X-Received: by 2002:a63:471d:: with SMTP id u29mr26259847pga.39.1559553064022; Mon, 03 Jun 2019 02:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559553064; cv=none; d=google.com; s=arc-20160816; b=Q55Hnr5ylzrI6MkKd9Ly3Z+QAIDtpTQLffaen498Im2136+m8zteSCRVF+teRa/gxN z8TAUQP0Tm03DeMVFmdGNaR6/GtF7cmxyl31G9Xz/TD8HTWZlLws4leQlPxSS5Es6Kgv JGFrk7UeGUhClU67FiJm5KbUzxoZmnoJVhdDXN94/woHWB+kbKeDHQuVrCS9WKupDZ5r 2LDRQnwxg5jH9N1VkWpg1rFn0LrjxSBf1CFbipxcXe9gVZVkpzLBUeAPN+Putd7iuXvn Iw7Jf6T1DaOx10xotE8nb1qFGcLOGKCL+9Nbem6Uu+/F2dj7L6IH/36LrXdM6ZyQFlqd rv8w== 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:dkim-signature; bh=iobI5d9Bso591kV58BjXAIxSTdpA85EgSWXJbRVwlpc=; b=uz+6nU6C28VvO+iHp3Krv68m5Pel3rZk7tIJgfahpDBuij5fJRHauvONCli7t0oID2 K2xQHBGJLnq9p6p4vTlW61jbooOIasgcbw8gfvCQ5Xmu+jxxBHnHYKmOeZ+fMD+rnwpr clQk+fAHD5yRG+uzvTVtkdLFTr7euVW4ArKMJXbojQhkaN3zMD5pzF7wkArrlJzQc+ft CcumciSCyqbvqsL/2exJPvZVxNJVlspSauPUE9gugAo0+SR45Z8NmJSFtGshqOEtyUZ2 2E4Ih3BFcz0oOiS+3YDm2SXVSLZm7mHEXAPWi/dQHsyqSX2gSS1OSLgGTMcGuPa28Fx2 0gKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=DYUs+VwW; 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 u4si16794543plq.193.2019.06.03.02.10.48; Mon, 03 Jun 2019 02:11:04 -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=merlin.20170209 header.b=DYUs+VwW; 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 S1727854AbfFCJJQ (ORCPT + 99 others); Mon, 3 Jun 2019 05:09:16 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50756 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbfFCJJP (ORCPT ); Mon, 3 Jun 2019 05:09:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iobI5d9Bso591kV58BjXAIxSTdpA85EgSWXJbRVwlpc=; b=DYUs+VwWkb9nlcxm1xlXveOuO 5OoKiJg+743cp3Ima8IPoEhhu4gRanbLY7KcisLRKyDuTOtQU5DOpjWx+ZALCoTLcO54X0gak0zRV ClaNKdIeEvARzHksnzVln8+aqVBfQBIiah4N77u69VFZXBEDgfn7cE4VUO7Zgu1rAEeXXhS60i0gD H3Wh0plIS6Qa2mLlrZF0F+ZL4lCquZK3eW9R0HvYtdFow4l7D3uhzDAu/nZ2S+RKH1BC5grVnvZKS gCeRpiBTibJNyaFSbgsrLAeDrOh+R3UZhoqpHIram1rK4B4C+vYlz7Qqtd4WaiTqHXu+XN+A014X/ hmAds8eUA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hXixo-0001lG-JX; Mon, 03 Jun 2019 09:09:08 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1F9E12025480C; Mon, 3 Jun 2019 11:09:06 +0200 (CEST) Date: Mon, 3 Jun 2019 11:09:06 +0200 From: Peter Zijlstra To: Roman Penyaev Cc: azat@libevent.org, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 06/13] epoll: introduce helpers for adding/removing events to uring Message-ID: <20190603090906.GE3436@hirez.programming.kicks-ass.net> References: <20190516085810.31077-1-rpenyaev@suse.de> <20190516085810.31077-7-rpenyaev@suse.de> <20190531095607.GC17637@hirez.programming.kicks-ass.net> <274e29d102133f3be1f309c66cb0af36@suse.de> <20190531125636.GZ2606@hirez.programming.kicks-ass.net> <98e74ceeefdffc9b50fb33e597d270f7@suse.de> <20190531165144.GE2606@hirez.programming.kicks-ass.net> <9e13f80872e5b6c96e9cd3343e27b1f1@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e13f80872e5b6c96e9cd3343e27b1f1@suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 08:58:19PM +0200, Roman Penyaev wrote: > On 2019-05-31 18:51, Peter Zijlstra wrote: > > But like you show, it can be done. It also makes the thing wait-free, as > > opposed to merely lockless. > > You think it's better? I did not like this variant from the very > beginning because of the unnecessary complexity. But maybe you're > right. No busy loops on user side makes it wait-free. And also > I can avoid c11 in kernel using cmpxchg along with atomic_t. Imagine the (v)CPU going for an extended nap right between publishing the new tail and writing the !0 entry. Then your userspace is stuck burning cycles without getting anything useful done.