Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3243274imm; Fri, 20 Jul 2018 12:43:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSNfA3GXkQHQASitOYHkiIznmSR/wlqbgX2Sp6eE+ZqVCsHSEqPypu6JrgCOiSTpn87Yf3 X-Received: by 2002:a63:175b:: with SMTP id 27-v6mr3227524pgx.31.1532115783487; Fri, 20 Jul 2018 12:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532115783; cv=none; d=google.com; s=arc-20160816; b=0H5jcudBqyCiXq4p4pJIOI1HbnBqWvgevdpZfUohVU5X5DHPJMzP1bJEHcqoJs3Dr+ zWConiEdQOHoxwjZk2t7wQ2dsAm+birlkrR/weWwtvj57uP/LeYgwaT6mDqGfIJVoOp4 fubtMAWfmLiNP7Sfo99JPThJLH6A80rqi81kmbdaw1YIw8xQ3mjuzPVARKThd1IeI1x7 caICcvFZZCbnf0RkAC7NI/7NckQujUfHqZTN5d+XZf/Gl8mzhQHtn5ACFxBHGPHfiHT8 az/puMMZ8p0NHMSqZVeVmAVj4fU9FzHnMe/9pmeL8qOeULPMMctu1xNqRrqRQRM9OZnK vSUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=OHFYdHSCFpgNvLJsGnnsdib0FhS5MWdZruiDTa8Rma8=; b=sw7vLPi8vPA8xgWtoioI3yMxT8qcYOzXt/G1jtGycfPK0hf3/dqsFmO0dv/I4V68gC 3qN3tlWvWSYsge2XAxwvM2XmSilGQBly84Ot+qMrSH5AkN2Kz0p6atX5vXTh1k7wpHL7 Xrdsd266n8IX8K5GaTy+AH9n8COhk/v0ulzszEbNwoz5vAXqwmb2h3AaBqlRGBgCy44R QKRliq9j3p3qT+9yWFCMbTeM9r63VB5FdzYNEWoOiHI2QBalHl58339RyW1CVr7UZUUc nK0rFjFhrNnUgadZQGzx6okz1w1SjeWHrGAf7Lkjo9Gn6fgP8DqXPj7Hl/N+G0B/6dl1 o35A== 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 e9-v6si2254193pgu.636.2018.07.20.12.42.48; Fri, 20 Jul 2018 12:43:03 -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 S1727630AbeGTUb5 (ORCPT + 99 others); Fri, 20 Jul 2018 16:31:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44350 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbeGTUb5 (ORCPT ); Fri, 20 Jul 2018 16:31:57 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D5399D4C; Fri, 20 Jul 2018 19:42:13 +0000 (UTC) Date: Fri, 20 Jul 2018 12:42:12 -0700 From: Andrew Morton To: Davidlohr Bueso Cc: jbaron@akamai.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH -next 0/2] fs/epoll: loosen irq safety when possible Message-Id: <20180720124212.7260d76d83e2b8e5e3349ea5@linux-foundation.org> In-Reply-To: <20180720172956.2883-1-dave@stgolabs.net> References: <20180720172956.2883-1-dave@stgolabs.net> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jul 2018 10:29:54 -0700 Davidlohr Bueso wrote: > Hi, > > Both patches replace saving+restoring interrupts when taking the > ep->lock (now the waitqueue lock), with just disabling local irqs. > This shows immediate performance benefits in patch 1 for an epoll > workload running on Xen. 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()? > The main concern we need to have with this > sort of changes in epoll is the ep_poll_callback() which is passed > to the wait queue wakeup and is done very often under irq context, > this patch does not touch this call. Yeah, these changes are scary. For the code as it stands now, and for the code as it evolves. I'd have more confidence if we had some warning mechanism if we run spin_lock_irq() when IRQs are disabled, which is probably-a-bug. But afaict we don't have that. Probably for good reasons - I wonder what they are? > Patches have been tested pretty heavily with the customer workload, > microbenchmarks, ltp testcases and two high level workloads that > use epoll under the hood: nginx and libevent benchmarks. > > Details are in the individual patches. > > Applies on top of mmotd. Please convince me about the performance benefits?