Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1248733imm; Tue, 22 May 2018 00:37:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo5ryDUJvCqnHi8uIwdENzhDZu0G72kasonyPNG+FLUgllfilN6Q7ThaoCTAKAwi073qJz7 X-Received: by 2002:a17:902:6006:: with SMTP id r6-v6mr23208605plj.70.1526974643318; Tue, 22 May 2018 00:37:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526974643; cv=none; d=google.com; s=arc-20160816; b=X8acwU84J2TpCiiGAJyr8JOfxUgn1n0n7QkjrsNnPHFCvtvOTMdKBoQPdOeUKJcy1E fnvmwuehtNTTxTYq4WShSs7wjQwra/ZEJua8ijyf5U22GZr9Oi7hlaycvp1yAkpAAz/X k8ulGDaVbIAEknGLjtDLx4WUEW8r/UJyy7Nvtq7PN8nB/K8lmIZC0mcZ336rIyW0JRo8 D7NwanGOpj7ZP6lQRoMdwDUYju7yJ6mSQhcFvPvYkjN5oDMlKgjoAkU7BX76MUX6yBV4 QiUwQrpE/+1OqnoQ33GALHmp4mTFS0fnpWqWB+4vqdM+9GPPNlft5XvKXXolgBSMr7OO y9gA== 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:arc-authentication-results; bh=Z6pJdRm0gwyHM/OJz1jwJtpTT3RuG1oPLHRupsIDh+k=; b=QjAs59zEdMiwLGpw2aJAQH4c3cogfElg0TBhGgdFZIjt/T0ZZBoraITHcbVCN6lSWV ZYE156+MUBtGTEuamnn1PhVcgZvk58752y/4NacBBAqSpDNPDOixV2psQ33EvjisMNS2 sXoGcDerPaskQTdCQDtk6M6NIrPwthRMDwO8aCybP5L1fOt5sELkdMKDoFnFu6u2HqGM ZcE76kk7SlyXPh47U+k1jdeDomtn7i30ff20NuiX6HRqR+d5gauMrWkbjwjSQMdyBe2D 3nryrZeI3iHe3CPoT1u58cYDvphbZa7v/mA8ZpqPWtOKuEOHJPYgiHC0T/MQmAKAwx1B sGxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=rg5n5yij; 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 u10-v6si12481523pgo.31.2018.05.22.00.37.08; Tue, 22 May 2018 00:37:23 -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=rg5n5yij; 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 S1751414AbeEVHhC (ORCPT + 99 others); Tue, 22 May 2018 03:37:02 -0400 Received: from merlin.infradead.org ([205.233.59.134]:49374 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751278AbeEVHhA (ORCPT ); Tue, 22 May 2018 03:37:00 -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=Z6pJdRm0gwyHM/OJz1jwJtpTT3RuG1oPLHRupsIDh+k=; b=rg5n5yij9wk/CjnxuMiOW5Psl e9UmABPgnpZZDC+mX7fmL6ifd9Hklzel211lWNza2myFjLE4TroSbL+nsqkhnJaYpQDrlry0uURvF QdYchFIRmZmtOKxeJj8u78l1ROAD5bX7zi0mNcsV6TH/94XwSMyEfFzn2BXRUpaAVah41SuDuIh0J UlBG8KtDfXZFrRnOKwLx+vtmZqllysQlSbulO8fn7QsgXqDvRtYGzlF+cZtosBKOsohHx9cN6MMjo /K8Jisv4wXbCPiN1zy+4YTYkRu7TLMSHeAkxHZW++HauFp3DAZOWhWqlKHXewjvGVSqqfe6uuwSyS v8UYzL1lQ==; 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 1fL1qH-0002ux-1k; Tue, 22 May 2018 07:36:21 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 463512029F869; Tue, 22 May 2018 09:36:18 +0200 (CEST) Date: Tue, 22 May 2018 09:36:18 +0200 From: Peter Zijlstra To: Sai Praneeth Prakhya Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Lee Chun-Yi , Borislav Petkov , Tony Luck , Will Deacon , Dave Hansen , Mark Rutland , Bhupesh Sharma , Naresh Bhat , Ricardo Neri , Ravi Shankar , Matt Fleming , Dan Williams , Ard Biesheuvel , Miguel Ojeda Subject: Re: [PATCH V3 2/3] efi: Introduce efi_queue_work() to queue any efi_runtime_service() on efi_rts_wq Message-ID: <20180522073618.GN12198@hirez.programming.kicks-ass.net> References: <1526958784-14688-1-git-send-email-sai.praneeth.prakhya@intel.com> <1526958784-14688-3-git-send-email-sai.praneeth.prakhya@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1526958784-14688-3-git-send-email-sai.praneeth.prakhya@intel.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 21, 2018 at 08:13:03PM -0700, Sai Praneeth Prakhya wrote: > + /* \ > + * queue_work() returns 0 if work was already on queue, \ > + * _ideally_ this should never happen. \ > + */ \ > + if (queue_work(efi_rts_wq, &efi_rts_work.work)) \ > + flush_work(&efi_rts_work.work); \ Since you're _always_ going to wait for it, it is _much_ cheaper to put a completion in your actual work and wait for that.