Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp974450lqs; Wed, 6 Mar 2024 02:26:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX3Qulpx7AvJZJKpBRHrkgV639blLH7rAfGfp7hVLMDhGgVPwTNHNuwY3m3v98Lat2G6zmHU02SWuQV1oyE9vLtiD5FvrBwsIc74YRF+A== X-Google-Smtp-Source: AGHT+IF67vVjo4XWN9SUqZ21MiW84usbzB/drjjOEeBkrAr5eBCh2Q01xb2No6uBIbx31Nly7/K1 X-Received: by 2002:aca:1915:0:b0:3c1:eecd:b68b with SMTP id l21-20020aca1915000000b003c1eecdb68bmr4044699oii.11.1709720802954; Wed, 06 Mar 2024 02:26:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709720802; cv=pass; d=google.com; s=arc-20160816; b=V44nisMVwDG7Tn/84rhXsvvQuGZRw7YDd7GMgj1ia/B/XNmszwGc/WsOR0TFNBm4Rv yfrGKm1lTHc0KI08Gn8WOdTZ+MhYhwbZHRifH1tPU4h4n5c9gTAikuyc8K9xhme4HqPE aIKZ+RWwJaGQ3UUyI3/D99KWAt6yrCtZ4QtQ5J2BmtzGzXHETQr5dHNr9y1sD/ESGCq4 DG6ukcDV+CHG86rQE+r2aCkjQZ+IP/I7+REmsVzfNl8Fj1Vu32vp2kkHL7a5jI7el6O8 3qL84mnPrw7E6cfUaJ46jDNpMr7/7mVuCl/IY9mNdcVhEpWfViVCcD5bSJWlpxCPIsKx qlCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=h1sc6HXuCrxiSnNkExDrDx4LaNTePU3zIJt7nkVPy0U=; fh=lQ2M4e1FRnWVc02SlCLk2j1DdH8ys+lfLCZTieMVhWc=; b=eQ3KWA2kpFg0k8yOzQ7AZWsdv/D6oEtuZhu1M+P7CXfJln75O2d/WEwhC9OcGvriwU F6+fiyEt57SeN5zsU32CJTw/TtlCUG4NIUSacrPML1p4ES3zLZbDXOTvCB6+o7zEK1gT R+s2zB31kInScag6xLX6e3MRPhGBCa9JanmyjsLd9xbnqDXauDQkrWJtTSikKUXiQ3RU qsOuMSjKBv9/60mIM5+AD6JZ+ucAu/C/IhFwF3bcUGDoSh5UCrnC6W9m53MyVqNLYucn hcJL6vQeFBwe1h8hTBQRZ9pds5U5AFa6zHw17b7ccvkavath6ShM7J6E3IaYI7vgzWVw t2Cg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-93750-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93750-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o7-20020a63e347000000b005e45abbc54asi11702886pgj.186.2024.03.06.02.26.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 02:26:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93750-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-93750-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93750-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CC60290F3D for ; Wed, 6 Mar 2024 10:26:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 822C760892; Wed, 6 Mar 2024 10:25:14 +0000 (UTC) Received: from out187-15.us.a.mail.aliyun.com (out187-15.us.a.mail.aliyun.com [47.90.187.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFC525F869 for ; Wed, 6 Mar 2024 10:25:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.187.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709720714; cv=none; b=j418ZjkLNPhdiriHB8J/axbMx8bLUnKlc6n5UQ+THIcUTa2+mA6YSsna0qfMEQDpomE9GKIqJikVMnjeLodC3kUOgNHcnkJwDY3yuXaotxt6wKtpHtFmlDoqSrj97mQyfP453Mxl6lbczVtbeOe7AGkIV/K/DTPwnVy4ti+/77c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709720714; c=relaxed/simple; bh=aeIv3sGdCkzoeZ0Sga2roNKU5ZWZgPhlxgVKkJoerUE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hkVu8AjF0MQo638UfpuO7p0Q8yJnymwshrCACzqnQBhRf62Af0mjE0HAms5n83LNVTkC2chWho83KqNxtBFjT0npNnYG3itutokk+rHxa5VxWu4WytPq7M45Q5nIGJlhn2QGJdATi9LNHbEDWhKOwgDn0KQClli3JMCjVE7TRNU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; arc=none smtp.client-ip=47.90.187.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R321e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047193;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.Wgbn-Jv_1709720383; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.Wgbn-Jv_1709720383) by smtp.aliyun-inc.com; Wed, 06 Mar 2024 18:19:43 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , , , "Tiwei Bie" Subject: [PATCH v3 6/9] um: Stop tracking host PID in cpu_tasks Date: Wed, 06 Mar 2024 18:19:22 +0800 Message-Id: <20240306101925.1088870-7-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240306101925.1088870-1-tiwei.btw@antgroup.com> References: <20240306101925.1088870-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The host PID tracked in 'cpu_tasks' is no longer used. Stopping tracking it will also save some cycles. Signed-off-by: Tiwei Bie --- arch/um/include/shared/as-layout.h | 1 - arch/um/kernel/process.c | 12 ++---------- arch/um/kernel/skas/process.c | 4 ---- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h index 9ec3015bc5e2..c22f46a757dc 100644 --- a/arch/um/include/shared/as-layout.h +++ b/arch/um/include/shared/as-layout.h @@ -31,7 +31,6 @@ #include struct cpu_task { - int pid; void *task; }; diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 4235e2ca2664..1201c1a79b23 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -43,13 +43,7 @@ * cares about its entry, so it's OK if another processor is modifying its * entry. */ -struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } }; - -static inline int external_pid(void) -{ - /* FIXME: Need to look up userspace_pid by cpu */ - return userspace_pid[0]; -} +struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { NULL } }; void free_stack(unsigned long stack, int order) { @@ -70,8 +64,7 @@ unsigned long alloc_stack(int order, int atomic) static inline void set_current(struct task_struct *task) { - cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) - { external_pid(), task }); + cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task) { task }); } extern void arch_switch_to(struct task_struct *to); @@ -208,7 +201,6 @@ void um_idle_sleep(void) void arch_cpu_idle(void) { - cpu_tasks[current_thread_info()->cpu].pid = os_getpid(); um_idle_sleep(); } diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index fdd5922f9222..99a5cbb36083 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c @@ -18,12 +18,8 @@ extern void start_kernel(void); static int __init start_kernel_proc(void *unused) { - int pid; - block_signals_trace(); - pid = os_getpid(); - cpu_tasks[0].pid = pid; cpu_tasks[0].task = current; start_kernel(); -- 2.34.1