Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4903405imu; Tue, 8 Jan 2019 08:11:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5iOYKSjdEH1gIuZq11FftjX9yJgGIG0Ds4E1gV+qgDPRCaN3yFAIRMZNpYva4i1k2Uj7jt X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr2400628plb.0.1546963885437; Tue, 08 Jan 2019 08:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546963885; cv=none; d=google.com; s=arc-20160816; b=vI5gW1UPBU8jRTwNlGCCHpCceodFcqp4r6e3z2lf3JIovfotdHPwPDlu3xjo42UVcG nSRPXQkcdYPVFGexL1ZE++EzUb5ymDgnSeJ7LDo8Ut5FWt/PMH0AsS7Fo3Cw1/xpgYtM w80OSsXxuq20V4ovZNrq81fRUN8GL29Y0JV3b5CIW3f4ugMvcrqu49UAK+frRYbs/FZw PIiX0roLdMjhkFWdYPb1wDPMgP8p+4t+daiGidruYFoKPEntKOUMpE9hkjKX1SeXMVGl egUvgZle4G9+wIy/RytO3GJNk7pIGIiSdRm1fxMlsXEBDjcdh/oZdQMh+G6qOcGCk5mn Mkmg== 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=Q/7LzLhBbXNJ3W7uyA5NVsHQvmHO1O4pl0gLMaTv+vQ=; b=grXq9zv23Tb/44ntIOGzKHOUwxhr7ILL6geUdHyXABvQpVm+9Apmq0Gjv01JsGT06z dwg3R06kk83MYzWzGm6p3yve1pRVSeJ5AyrE+5eOHzOtdkFd7zc5nTUwzs7hKeumJyd5 yYnxeeWxQEFCHsCXZPkdEugn23arblYdT0Iq9LFpxYoDJsxyqQpiqmnafpa+wSlGOjJP xI/zB/UmkTFKMAw3N+nlII8CXIYAyWHxn329NGpXOEelgpuK6bVtfby7arUG3AoRYagn Gol3F60ngtt9zTlSTQtZdXnOyTtdNG/UOUshwTKNenDnsgGkf1cOa9v8ilIVseGZfluU mRyw== 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 u186si27051194pgd.131.2019.01.08.08.10.45; Tue, 08 Jan 2019 08:11:25 -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 S1729184AbfAHQHZ (ORCPT + 99 others); Tue, 8 Jan 2019 11:07:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:41110 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728238AbfAHQHY (ORCPT ); Tue, 8 Jan 2019 11:07:24 -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 95928AEBC; Tue, 8 Jan 2019 16:07:23 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 08 Jan 2019 17:07:23 +0100 From: Roman Penyaev To: Davidlohr Bueso Cc: Jason Baron , Al Viro , Andrew Morton , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] epoll: remove wrong assert that ep_poll_callback is always called with irqs off In-Reply-To: <725cdce88418c2ec62ef6014d388dbeb@suse.de> References: <20190108100121.20247-1-rpenyaev@suse.de> <725cdce88418c2ec62ef6014d388dbeb@suse.de> Message-ID: <2cec506322600c3d2b59f2ca9bcd59dc@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-01-08 16:16, Davidlohr Bueso wrote: > On 2019-01-08 04:42, Roman Penyaev wrote: >> What we can do: >> >> a) disable irqs if we are not in interrupt. >> b) revert the patch completely. >> >> David, is it really crucial in terms of performance to avoid double >> local_irq_save() on Xen on this ep_poll_callback() hot path? > > Note that such optimizations are also relevant for baremetal, ie: x86 > PUSHF + POPF can be pretty expensive because of insn dependencies. > >> >> For example why not to do the following: >> >> if (!in_interrupt()) >> local_irq_save(flags); >> read_lock(ep->lock); >> >> with huge comment explaining performance number. >> >> Or just give up and simply revert the original patch completely >> and always call read_lock_irqsave(). > > Yeah so the reason why I had done the other epoll lock irq > optimizations was because they were painfully obvious. > ep_poll_callback(), however is a different beast, as you've > encountered. I vote for not shooting ourselves in the foot and just > dropping this patch -- most large performance benefits will come from > microbenches anyway. Then I will send another patch which changes read_lock() on read_lock_irqsave(), since simple revert of the original patch won't work. Thanks. -- Roman