From patchwork Tue Jun 29 02:35:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12348961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0762C11F69 for ; Tue, 29 Jun 2021 02:35:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 76F7B61D03 for ; Tue, 29 Jun 2021 02:35:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76F7B61D03 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CE0888D00A2; Mon, 28 Jun 2021 22:35:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB6E58D008F; Mon, 28 Jun 2021 22:35:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA6218D00A2; Mon, 28 Jun 2021 22:35:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0007.hostedemail.com [216.40.44.7]) by kanga.kvack.org (Postfix) with ESMTP id 933B18D008F for ; Mon, 28 Jun 2021 22:35:39 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 941611E076 for ; Tue, 29 Jun 2021 02:35:39 +0000 (UTC) X-FDA: 78305195598.22.DB72662 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf21.hostedemail.com (Postfix) with ESMTP id 43A0EE000243 for ; Tue, 29 Jun 2021 02:35:39 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EE6361D05; Tue, 29 Jun 2021 02:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1624934138; bh=xpzgoUUzkYvFxzfWCMXuSpOQKtpeCg+Um+XA1CvzUHs=; h=Date:From:To:Subject:In-Reply-To:From; b=Tkl7qmkKeXpHYVOmJWvZXcShRQ5SZUOF6BiuYN2wZs0eYyl36DbwA1HUz41/E0Ja0 MZDxWf8TcxYSyuAGIs/NOIcRvOxdyVNu4rpnYU3wWo4JqKI38EqFBsPuSRL8GY4Lsa D58zASCe8C1P5FNTXTqhoLuNJx2jfc8fEsYWdLI8= Date: Mon, 28 Jun 2021 19:35:37 -0700 From: Andrew Morton To: akpm@linux-foundation.org, hcochran@kernelspring.com, jack@suse.cz, linux-mm@kvack.org, mm-commits@vger.kernel.org, mszeredi@redhat.com, sedat.dilek@gmail.com, tj@kernel.org, torvalds@linux-foundation.org, wuchi.zero@gmail.com Subject: [patch 045/192] mm/page-writeback: use __this_cpu_inc() in account_page_dirtied() Message-ID: <20210629023537.JI2byLltW%akpm@linux-foundation.org> In-Reply-To: <20210628193256.008961950a714730751c1423@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Tkl7qmkK; dmarc=none; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam02 X-Stat-Signature: og5e16hie5woxkrd1yps8wjuyojuyqbo X-Rspamd-Queue-Id: 43A0EE000243 X-HE-Tag: 1624934139-425051 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Chi Wu Subject: mm/page-writeback: use __this_cpu_inc() in account_page_dirtied() As account_page_dirtied() was always protected by xa_lock_irqsave(), so using __this_cpu_inc() is better. Link: https://lkml.kernel.org/r/20210512144742.4764-1-wuchi.zero@gmail.com Signed-off-by: Chi Wu Reviewed-by: Jan Kara Cc: Howard Cochran Cc: Miklos Szeredi Cc: Sedat Dilek Cc: Tejun Heo Signed-off-by: Andrew Morton --- mm/page-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/page-writeback.c~mm-page-writeback-use-__this_cpu_inc-in-account_page_dirtied +++ a/mm/page-writeback.c @@ -2445,7 +2445,7 @@ void account_page_dirtied(struct page *p inc_wb_stat(wb, WB_DIRTIED); task_io_account_write(PAGE_SIZE); current->nr_dirtied++; - this_cpu_inc(bdp_ratelimits); + __this_cpu_inc(bdp_ratelimits); mem_cgroup_track_foreign_dirty(page, wb); }