Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1306555ybs; Mon, 25 May 2020 12:25:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcRDXwXNzyzkP2Zz0TPEEHiqa9iBsvoe7OFlM3/neIsTd7aDLNye6dufsl+VNaRodyPico X-Received: by 2002:a17:906:1f09:: with SMTP id w9mr19619414ejj.508.1590434741041; Mon, 25 May 2020 12:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590434741; cv=none; d=google.com; s=arc-20160816; b=OYg1AAhXrcdGYk+bSaym/uDTyKnq/RdrelJneQw+OwbF2au9Aw09DqMvAun48/qA4B A5OV2bDCqIVKPYUljtOYR1rteRo+3XZYrbQKOvGYeadEmCvKTNBo/pZH13XQ04bnZBv3 oDiuaZb1L+OdyDEXOB6oc+nnT7p7z5jLF6m+Pi+/tZSFY2BnbC5h1ODzGnwmMTNMzAJF arl4erslf1KSzm9CM1DHd6Ng1XrXogTW3iGOIGXCiaIIFlTKujhl7lciYDbRtBqs3YmY o0d8ECao4JMZZqwIhW8fBDljtpWX/3ljfCLKcYOnD2aD8h4cCj49uHdv8AL8wd6U3/Dj /TOg== 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:date:subject:cc:to:from :dkim-signature; bh=TB9a5RlSCttsRGqQbKXaUpDsmIDKmbhQMWP6LpH5XS4=; b=CmyWxFJNJYtYj1QqdQW5EwVLIevJGZsL+W26qy+O3DxRazlQR9v9by4pLj84nEAXcW Deog8NCtYtaQByIrIMaErze+dzRxnS86zqh61GsnNHWaELBwHagabFVFlGAGpHmDiju6 Euv/1mrvFkGth7rsTxP+CFZ8s/BKkO5EfMUTkN60TQg/rikNR3iifhCUXZ9YzsCrSYMF Uvh5FIjKGLFDY3Y1e5tmyU2EI2/9PZT5hWkxo/6Q4VCQEgdArexuWkK7CWxkDT2fMk+V X9O6ymz5y/eFDlByKR6mIMLotzhEhRAQGpLR2S6a+y9aN9PSmrmvER34QDoVOWRN82G/ 6BYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KOkjO60J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si10178325ejc.374.2020.05.25.12.25.17; Mon, 25 May 2020 12:25:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KOkjO60J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390161AbgEYLbJ (ORCPT + 99 others); Mon, 25 May 2020 07:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390375AbgEYLbF (ORCPT ); Mon, 25 May 2020 07:31:05 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF20BC061A0E; Mon, 25 May 2020 04:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=TB9a5RlSCttsRGqQbKXaUpDsmIDKmbhQMWP6LpH5XS4=; b=KOkjO60JkDEBMvWEo1GYPh4snb bJ8+zN9yjHGONDrfuMRNIvk0ajYpTp3a15bA3eUURd5e4/qCXCXNiZpcUtoiWhTebt10464OMCmt5 ZutE+uf/7M9uCgwA/xcae6KddONx528UGxSX4KDYS2akaVx6+xI4w99vT1B6lodGweHuyBhMDLReq VtB1JdAARkAe3UAI2IjVp5dVdoKDm7MtnBE9Q6y43YZEcs7AkkAq0JSAfWY2zqZf86X+NLHx4vkJL KTSb1lE+ouCWGkG5qwbmjI/ub4Eaa6FO52sW6KFUDYjGfbrqDiDyzys+kBAFHmsQWfJIsRnctv7yR IiDWuxIA==; Received: from [2001:4bb8:18c:5da7:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdBJt-0002ZD-Qy; Mon, 25 May 2020 11:31:02 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Konstantin Khlebnikov , Minchan Kim , Nitin Gupta , dm-devel@redhat.com, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/16] block: use __this_cpu_add() instead of access by smp_processor_id() Date: Mon, 25 May 2020 13:30:13 +0200 Message-Id: <20200525113014.345997-16-hch@lst.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200525113014.345997-1-hch@lst.de> References: <20200525113014.345997-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Konstantin Khlebnikov Most architectures have fast path to access percpu for current cpu. The required preempt_disable() is provided by part_stat_lock(). Signed-off-by: Konstantin Khlebnikov [hch: rebased] Signed-off-by: Christoph Hellwig --- include/linux/part_stat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/part_stat.h b/include/linux/part_stat.h index a6b0938ce82e9..24125778ef3ec 100644 --- a/include/linux/part_stat.h +++ b/include/linux/part_stat.h @@ -54,7 +54,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value) part_stat_read(part, field[STAT_DISCARD])) #define __part_stat_add(part, field, addnd) \ - (part_stat_get(part, field) += (addnd)) + __this_cpu_add((part)->dkstats->field, addnd) #define part_stat_add(part, field, addnd) do { \ __part_stat_add((part), field, addnd); \ -- 2.26.2