From patchwork Fri Jan 26 08:06:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13532171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E97E1C47422 for ; Fri, 26 Jan 2024 08:06:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5FAA78D0005; Fri, 26 Jan 2024 03:06:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A9378D0002; Fri, 26 Jan 2024 03:06:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44B448D0005; Fri, 26 Jan 2024 03:06:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2F84F8D0002 for ; Fri, 26 Jan 2024 03:06:50 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id EFD971A0800 for ; Fri, 26 Jan 2024 08:06:49 +0000 (UTC) X-FDA: 81720730938.24.9DD9B1D Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf17.hostedemail.com (Postfix) with ESMTP id 4C52440019 for ; Fri, 26 Jan 2024 08:06:48 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=XPTenpJ9; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3F2izZQoKCOgiYcbiKRWONQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--yosryahmed.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3F2izZQoKCOgiYcbiKRWONQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--yosryahmed.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706256408; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Q+MkK7elkwozxtf29PmL54XsONOmn3SLZnF2nfqAuzw=; b=4zpP4k3b3kFWo6xfa3lfwenLt88X2eh5lmWPmX0Hg4qT85vLK9KGomipZUOo1Gnuh7uXmt yyl+ozwE76H+2ybiXVz/j0nd0sUpcxPJ4k+lwqMXqQO1M8DRTgpYm2CWLAE1G8QL+phUK0 Hd0tf9y6r/j+VdFseA0I0/CyTNW1IV0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=XPTenpJ9; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf17.hostedemail.com: domain of 3F2izZQoKCOgiYcbiKRWONQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--yosryahmed.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3F2izZQoKCOgiYcbiKRWONQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--yosryahmed.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706256408; a=rsa-sha256; cv=none; b=CiKeq0EvsiC7dPPDvDYVTcVWjRrp+uotCK9fBb1VDyQc3g3x/Ch/uaaWdqbWy76HDBRdDR LWK1/WjMc6eYk5Q5ttK/mQOXhcOQQL+jl79PF/ymZV6UU3B824Ef9wV5YAo199zhxf9kDA bqmzO5WmoiZFGN2w8h23RDPSlElzrk4= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-602d22a54caso449417b3.3 for ; Fri, 26 Jan 2024 00:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706256407; x=1706861207; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Q+MkK7elkwozxtf29PmL54XsONOmn3SLZnF2nfqAuzw=; b=XPTenpJ9uLrH9R5hfHLaEth2WSYw/nlI1uv/aIYltBp4HqJN/MUkcnUqmz2Hxw6k0l M/ysPH38QiX5ahpYjtDiGGHY2vJ3Q79NccosonMmvQEIrCkMHEhGYpwjNQDafcvg1oDv 6MNL2pfjQlenYVGU7uMLjvY2onIzkCHtgJbzzQqGncxdjXzd4JtRi3OTr4D/tkGaybdI pMnXKfrUlLb36Exa500lip8hzJqJtlhDyH6TMyMy6LU70paec6ANrWCTbjRVwRfdNUYk ZP5Mb7DUylIQZjkt0jO6SEC5JXOAUdqbcxOlQcqdvIOQtRfgrdEGoqEwlFrnyQ9z7ibf Qxhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706256407; x=1706861207; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Q+MkK7elkwozxtf29PmL54XsONOmn3SLZnF2nfqAuzw=; b=v+CCGwUYt53R/0kS9XuAgsScURiMTQvxEPOl6WLSSfa851T9Vy287cFGCotiTlmpqi tg+eK37Ne6Agq5hwCsR43fbug6uPN4aQh2zcqIULiDIa6PDdrkXLNCYbT81VDfap9+K2 HYgKbiuVSZjxgX3PWanGSQdS7FFV2zaJwBPLSxtELfno8HFnax0HHdR/UlwRQOA5kJ/D e6PCt27wpqAJNVH+M4u48isUzXOpvMgg3UoL9HJdoEB5Fc+Af6g2fQ04yFCmeV1qudXq Ur9HUqVZjldq4d/wnlGaOhqLwneD+ThsqV0T4m3FKzCuygAmAfkrW99Tr7nXs7rsEixO aaMQ== X-Gm-Message-State: AOJu0YyI9oNM79Ofdh3DxbctOf8iz4IwjW8ZLVUJEbN8eQTwseUo1MiS W22Hpru51x+RmoHzmlyVs2IH+UlN5lsHpjRRGBOOrg0nc7YC/UeQkaa1K+Mr9MgArM2wwa3FxEK U4/fPjFinDeXUWbAA4g== X-Google-Smtp-Source: AGHT+IGU5QcjnbH97KOXGogNkkBb9OokhEIyAYw9IuZL/21fWEaWMGFuIPPbGaaXup7UnihTrxa26iMXfIYaPd+W X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a81:99cc:0:b0:5e7:12cc:a60f with SMTP id q195-20020a8199cc000000b005e712cca60fmr380957ywg.6.1706256407325; Fri, 26 Jan 2024 00:06:47 -0800 (PST) Date: Fri, 26 Jan 2024 08:06:43 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Message-ID: <20240126080644.1714297-1-yosryahmed@google.com> Subject: [PATCH 1/2] x86/mm: delete unused cpu argument to leave_mm() From: Yosry Ahmed To: Ingo Molnar Cc: Thomas Gleixner , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Andrew Morton , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 4C52440019 X-Stat-Signature: zt5dd8irmfto4buwiq15okdp6o6wb8zr X-HE-Tag: 1706256408-852965 X-HE-Meta: U2FsdGVkX19E7quhTvXXZY/TIMxWO19FAeXyTSEOuKB5Tosd2zHfpxWOWOXtlPf6OUSrn/oxvxMRQ4Tii4nYbr0rlFf49bti7Le50tcasU8g7+P3StFgQGrivrg5ApRi5kJe+9LVaSly82BIr7tfWkIjBBS0t/16BLkk9ilgtQirYMIGE6rm5fvGzwGDmsVrnnlGrXUftp9BqBhWEiKSn62oVA9KxlOzHkMuhh3pgGCdKwY3GAPPJcqcogW/xsatImL323Y1KnJtOnFO475N9Ya5bzyJjhESuHDQt7foJrQQVz0QSbIJWFoYKSZDDZE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Qz1rXJVs9kBStO7VjLf36rq5A52xKKfaKzlNKTASzSehQ7jjdBmMUz4oRUMCam8nSOqdN8WBexCh29wY3R6Sb65Wq/yjjrKoi4sGjAluRRbYlaJLhIMRAVnVtG8xkrw7YSkcnN1Rtp79wnYj/D6U/IlV/cE/T6thDcmQIkXRbby8h2MPOhD105fjNUkz2T+SZ8HxhutLXkYPbBe0ewotx6jrx9yYq2PoUOiUqb2wYt1hapKRyzR7JDaDJevVMspnXti2/aMnsH4BIMmMNyCZfqnrdfzBQ== 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: List-Subscribe: List-Unsubscribe: The argument is unused since commit 3d28ebceaffa ("x86/mm: Rework lazy TLB to track the actual loaded mm"), delete it. Signed-off-by: Yosry Ahmed --- arch/x86/include/asm/mmu.h | 2 +- arch/x86/kernel/alternative.c | 2 +- arch/x86/mm/tlb.c | 2 +- arch/x86/xen/mmu_pv.c | 2 +- drivers/cpuidle/cpuidle.c | 2 +- include/linux/mmu_context.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h index 0da5c227f490c..ce4677b8b7356 100644 --- a/arch/x86/include/asm/mmu.h +++ b/arch/x86/include/asm/mmu.h @@ -75,7 +75,7 @@ typedef struct { .lock = __MUTEX_INITIALIZER(mm.context.lock), \ } -void leave_mm(int cpu); +void leave_mm(void); #define leave_mm leave_mm #endif /* _ASM_X86_MMU_H */ diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index cc130b57542ac..66bd265c7a587 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -1805,7 +1805,7 @@ static inline temp_mm_state_t use_temporary_mm(struct mm_struct *mm) * restoring the previous mm. */ if (this_cpu_read(cpu_tlbstate_shared.is_lazy)) - leave_mm(smp_processor_id()); + leave_mm(); temp_state.mm = this_cpu_read(cpu_tlbstate.loaded_mm); switch_mm_irqs_off(NULL, mm, current); diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 5768d386efab6..80b0caa82a91b 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -299,7 +299,7 @@ static void load_new_mm_cr3(pgd_t *pgdir, u16 new_asid, unsigned long lam, write_cr3(new_mm_cr3); } -void leave_mm(int cpu) +void leave_mm(void) { struct mm_struct *loaded_mm = this_cpu_read(cpu_tlbstate.loaded_mm); diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c index 72af496a160c8..218773cfb009f 100644 --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -913,7 +913,7 @@ static void drop_mm_ref_this_cpu(void *info) struct mm_struct *mm = info; if (this_cpu_read(cpu_tlbstate.loaded_mm) == mm) - leave_mm(smp_processor_id()); + leave_mm(); /* * If this cpu still has a stale cr3 reference, then make sure diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 737a026ef58a3..02e40fd7d948c 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -237,7 +237,7 @@ noinstr int cpuidle_enter_state(struct cpuidle_device *dev, } if (target_state->flags & CPUIDLE_FLAG_TLB_FLUSHED) - leave_mm(dev->cpu); + leave_mm(); /* Take note of the planned idle state. */ sched_idle_set_state(target_state); diff --git a/include/linux/mmu_context.h b/include/linux/mmu_context.h index f2b7a3f040999..bbaec80c78c50 100644 --- a/include/linux/mmu_context.h +++ b/include/linux/mmu_context.h @@ -11,7 +11,7 @@ #endif #ifndef leave_mm -static inline void leave_mm(int cpu) { } +static inline void leave_mm(void) { } #endif /*