From patchwork Fri Jul 23 22:50:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12397111 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,URIBL_BLOCKED autolearn=ham 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 CDB45C4338F for ; Fri, 23 Jul 2021 22:50:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7BCE260EB5 for ; Fri, 23 Jul 2021 22:50:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7BCE260EB5 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=kvack.org Received: by kanga.kvack.org (Postfix) id 2342F6B007E; Fri, 23 Jul 2021 18:50:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E4546B0080; Fri, 23 Jul 2021 18:50:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D3DC6B0081; Fri, 23 Jul 2021 18:50:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id E4E466B007E for ; Fri, 23 Jul 2021 18:50:40 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 98C071810C481 for ; Fri, 23 Jul 2021 22:50:40 +0000 (UTC) X-FDA: 78395348640.18.EA944DD Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf23.hostedemail.com (Postfix) with ESMTP id 2EA399004BEB for ; Fri, 23 Jul 2021 22:50:40 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 345D760EB5; Fri, 23 Jul 2021 22:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1627080639; bh=MjVWOlwxEnyXFMcGd7wYkPesTcfyvbVCGVsHFNt63Mk=; h=Date:From:To:Subject:In-Reply-To:From; b=Jiyha2YZwX/tK0BEtEhXU6agivtiThuj83gOJbPPzkX7h+MSn61yxP3bQAJ1cHI9W f1NkjiIB7+7aFIN+1a4fARj9tG1eoX+5nWmo+jl5D497e6POo8puKBRuGBNe8mESze CSxkxo55I3Vv20/BCSW1mQbHsg0D1wYXcxn+vXr4= Date: Fri, 23 Jul 2021 15:50:38 -0700 From: Andrew Morton To: akpm@linux-foundation.org, linux-mm@kvack.org, mgorman@techsingularity.net, mm-commits@vger.kernel.org, pankaj.gupta@ionos.com, shy828301@gmail.com, songmuchun@bytedance.com, torvalds@linux-foundation.org Subject: [patch 13/15] mm: mmap_lock: fix disabling preemption directly Message-ID: <20210723225038.7yIzuPTXo%akpm@linux-foundation.org> In-Reply-To: <20210723154926.c6cda0f262b1990b950a5886@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2EA399004BEB Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=Jiyha2YZ; dmarc=none; spf=pass (imf23.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: ii3x587e3kfdi4uie1nyaca5qapax761 X-HE-Tag: 1627080640-392943 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: Muchun Song Subject: mm: mmap_lock: fix disabling preemption directly The commit 832b50725373 ("mm: mmap_lock: use local locks instead of disabling preemption") fix a bug by using local locks. But commit d01079f3d0c0 ("mm/mmap_lock: remove dead code for !CONFIG_TRACING configurations") changes those lines to original version. I guess it is introduced by the conflicts fixing on merging. Link: https://lkml.kernel.org/r/20210720074228.76342-1-songmuchun@bytedance.com Fixes: d01079f3d0c0 ("mm/mmap_lock: remove dead code for !CONFIG_TRACING configurations") Signed-off-by: Muchun Song Acked-by: Mel Gorman Reviewed-by: Yang Shi Reviewed-by: Pankaj Gupta Signed-off-by: Andrew Morton --- mm/mmap_lock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/mmap_lock.c~mm-mmap_lock-fix-disabling-preemption-directly +++ a/mm/mmap_lock.c @@ -156,14 +156,14 @@ static inline void put_memcg_path_buf(vo #define TRACE_MMAP_LOCK_EVENT(type, mm, ...) \ do { \ const char *memcg_path; \ - preempt_disable(); \ + local_lock(&memcg_paths.lock); \ memcg_path = get_mm_memcg_path(mm); \ trace_mmap_lock_##type(mm, \ memcg_path != NULL ? memcg_path : "", \ ##__VA_ARGS__); \ if (likely(memcg_path != NULL)) \ put_memcg_path_buf(); \ - preempt_enable(); \ + local_unlock(&memcg_paths.lock); \ } while (0) #else /* !CONFIG_MEMCG */