Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4412111ybi; Mon, 3 Jun 2019 10:24:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVT+dPf09QYZ9qc03bB09WWVujdMEoxl6qjRUHp5FI9KJrXP+0wsVfx0G5x4iNb7R+sTs1 X-Received: by 2002:a17:90a:734a:: with SMTP id j10mr31701061pjs.92.1559582670259; Mon, 03 Jun 2019 10:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559582670; cv=none; d=google.com; s=arc-20160816; b=FYbf4LAuA9dOdz+deAwJeQibV3HzGuc2PRLzljD5N5CYKFX9pnhYznxtI6U0ZI/S/T CJIvpLe64StgVaO/esLMzM2ACPWrJVcYB9VcJIYkoucbxAY2SltHCiqKQja4vUNXdvLe XN8s63ZeE1PtiIS9auKA2ErETPlYx3AoslanuU38QCeY8OFX+RuwE2cjz1XRp9Cjguse xPNVdOM3CqEG5q8XUd/HSMNj2eQOhkCOGKhN+0Tqw3XHhqZbFehZO98L8rY46ZCpnnHi dGmQoWWzlX/3PUuGNGNIT/dgxOHjl8B1QkdD6yIT4dt5oG4u7C69ylI9jf76Uev18JFf uzqg== 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:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=IK4z7GFbrH7D56Va0zb6c4DDJz/NqHkj5JtmNWy58iE=; b=fNNqjIw8uCmMhJr2wU57JhlZ+bGLo+uw5Q/t7FJ9p8HzcDEqX9RebVgmgFPYkCUpVH dXpDDkXa7f7U7c45wkriUE+GZTPzXeuCufuNSkMOTpcmex5BMiA52Oz71q1ryvqMxdGO f3TyAKtQNv7avp+P26T8VlSZAXSa2FV+5+l7yVuSTb1EHBxFfEqcPo/NXkTFacKxvs25 QYaAV0R7P7sf6W1l0N+Z/rsekGphzE7HDNCAtwOakuAMiQdX/qePeDiKOvAgkjANqmmI Y9okH4RVYtuaPhZ3PlS09T8ESphKKR2FHkVsKHQKgkfuj1oi6IMe9Y4GorCqgesoRTGB Girg== 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 n4si20155276pff.62.2019.06.03.10.24.14; Mon, 03 Jun 2019 10:24:30 -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; 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 S1726909AbfFCKCu (ORCPT + 99 others); Mon, 3 Jun 2019 06:02:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:52992 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726270AbfFCKCu (ORCPT ); Mon, 3 Jun 2019 06:02:50 -0400 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 B558DAFE1; Mon, 3 Jun 2019 10:02:22 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 03 Jun 2019 12:02:22 +0200 From: Roman Penyaev To: Peter Zijlstra 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 In-Reply-To: <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> <20190603090906.GE3436@hirez.programming.kicks-ass.net> Message-ID: <904d7aea51552c9be9afb3b19bfac66b@suse.de> X-Sender: rpenyaev@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 2019-06-03 11:09, Peter Zijlstra wrote: > 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. Yes, that is absolutely not nice. That also worries me. I wanted to minimize number of atomic ops on hot path, and of course in that respect this busy-loop is more attractive. I will polish and switch back to the wait-free variant and resend the whole patchset. Could you please take a look? Will add you to CC. -- Roman