Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1121629imm; Thu, 6 Sep 2018 16:03:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaEPHmRZWu5DDR711qiQTYn4jGtRnp1j2hXeg95kI+UZ769FlVfTo48bTGxZl453M7w6WWF X-Received: by 2002:a62:e11:: with SMTP id w17-v6mr5463649pfi.242.1536274989384; Thu, 06 Sep 2018 16:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536274989; cv=none; d=google.com; s=arc-20160816; b=zms7gG0MMK6QlCcTIzPfugXVqRyY9G8JUR3qszcxRCTEE7G40Ea8zRaLU7YHG14xyR q5zkdTjF/oo/irmCTGVrXowdFCBFiACue/FNCWO6oZIpx/otVGy1usQvPrJEcVvWmcM2 n22ju3eOphkQyVLyG/rZHjyhefzwJGsphQMjhvdwI/HQF9DjyMVkkAxoU7lPjQ32RSNP v8b+fh4TPwOn5O4L45/a/i/kQvNMfF++lIm0Eo28GjGDBXF5SW4KpClqgRV+zCacVLWJ gEQ8rmcbR4yliDnUtHStgcM4UI1QPe30lP3xPJN+cUkNk1pM/mIPE7dFkkdbP0rBNaV2 aO2Q== 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=x6s3ALmHkj1+2X4Ckhp5WiBndVI6w4y4xrMj3JYhY/s=; b=mUaLfnwmT7JLcKx29DlEpus55L1C1418RSFRHswsU+QdKooC9EMPy8mAqx8B00eQii K96H29gQPww7VbdSgCg1fw7UtJXOk1XgE2+sB+CEVCj/2tAbOeJGfJ+fAPJqlxpGFk7O m5hKCopwRPTEw2RoerC5AH+0gmM6KPvgctvo4lhExi4WskHuJNOASmARPRG6KzBCDoZY A2hpzHqI0Hs5Rp06TLu76sIwSgpHWcvtmtZ/Gb6Mi7hpcx0ZQU5mPFJrE+0bfa8oZPFw SNq26BHMCR0JgH0CbkWVx4RinRWeIpMW4UEx1zoeTG2UQ9eMDRmiFSilX9SyT6HUVvgf QnHw== 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 g27-v6si6364457pgm.208.2018.09.06.16.02.53; Thu, 06 Sep 2018 16:03:09 -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 S1728141AbeIGBck (ORCPT + 99 others); Thu, 6 Sep 2018 21:32:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:53388 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727770AbeIGBck (ORCPT ); Thu, 6 Sep 2018 21:32:40 -0400 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 1DD26ABEF; Thu, 6 Sep 2018 20:55:25 +0000 (UTC) Date: Thu, 6 Sep 2018 13:55:17 -0700 From: Davidlohr Bueso To: Peter Zijlstra Cc: Andrew Morton , jbaron@akamai.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible Message-ID: <20180906205517.GC31080@linux-r8p5> References: <20180720172956.2883-1-dave@stgolabs.net> <20180720124212.7260d76d83e2b8e5e3349ea5@linux-foundation.org> <20180720200559.27nc7j2rrxpy5p3n@linux-r8p5> <20180906191140.GA4816@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180906191140.GA4816@worktop.programming.kicks-ass.net> 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 Thu, 06 Sep 2018, Peter Zijlstra wrote: >On Fri, Jul 20, 2018 at 01:05:59PM -0700, Davidlohr Bueso wrote: >> On Fri, 20 Jul 2018, Andrew Morton wrote: > >> >I'm surprised. Is spin_lock_irqsave() significantly more expensive >> >than spin_lock_irq()? Relative to all the other stuff those functions >> >are doing? If so, how come? Some architectural thing makes >> >local_irq_save() much more costly than local_irq_disable()? >> >> For example, if you compare x86 native_restore_fl() to xen_restore_fl(), >> the cost of Xen is much higher. > >Xen is a moot argument. IIRC the point is that POPF (as used by >*irqrestore()) is a very expensive operation because it changes all >flags and thus has very 'difficult' instruction dependencies, killing >the front end reorder and generating a giant bubble in the pipeline. > >Similarly, I suppose PUSHF is an expensive instruction because it needs >all the flags 'stable' and thus needs to wait for a fair number of prior >instructions to retire before it can get on with it. > >Combined the whole PUSHF + POPF is _far_ more expensive than STI + CLI, >because the latter only has dependencies on instructions that muck about >with IF -- not that many. ack. In fact it turns out that my Xen numbers for this patch were actually native (popf), and not the xen_restore_fl() as it was using hvm and not paravirt. Thanks, Davidlohr