From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CBD6D64099 for ; Sat, 9 Nov 2024 01:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1Q4mBwHzI1Zmiy6+Ogfr8sqNUW8HJIFzhPVAIj0jp2c=; b=C4fGRTd5tmAZEUUEAZTOg3UTsV LUyPztHyWRA+V5Am+PkoPRuOgWCHST8mYk1SWw+Gw/peCq+l45NIndI+Rzi+lEaZXMylW6Km7PxBB iLjAjYma3+oKrsN7MBXzjw9x42+nasuD9VC2Rbwn/fhSVDSuj2tJ9Jci4o/9QAGwdTsoiOQTeiJ3Q u0pILgp8a1IF2XWA7EZhYJkwiIJpEMuc7whOl8qf7rDn/Yk+XePBWSwzJ9zXbNrJUpUEfeJv3P7A+ ukq13OvndabrAGzgfhJ5v0Hb0SVe5fgXD21wex6YLxpZ+ihGCLwzMjNZINWM+nBK7Ip5fIMs33GO4 i34SqBBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t9ZtK-0000000CP2t-3fDu; Sat, 09 Nov 2024 01:03:54 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t9ZtI-0000000CP2W-0x8X for linux-um@lists.infradead.org; Sat, 09 Nov 2024 01:03:53 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-7240d93fffdso1930148b3a.2 for ; Fri, 08 Nov 2024 17:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731114231; x=1731719031; darn=lists.infradead.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=1Q4mBwHzI1Zmiy6+Ogfr8sqNUW8HJIFzhPVAIj0jp2c=; b=PcrRUJEYg6CjJKsQmRProKZUbvypKcac4iU89T8zLNKOmPVc1cSB3usx8EEpw2mhYu Qhb78lihWLLc3d+BUG7+xKkxf+pCR8u7m45fxJBbZLhToHyv7fk4oltMq+YpDoduWgAS Uy3xOEgcX96SPkCVLSgPamCggAPkntvF4AdkN0GML7EVhzJfZynLTaZeNtsmT20c9gWv 1Mcw79Q001aApSvstIEbnoreDVuF/HcLKvfaDwPsLPCsPGEoFGt2+DYT5qp9FVMxA5YU isyN+FbD/MEOXV1//PN2wKkRj0rWT2OrUxknLKbyThPSOEi2GGjX2M8abfDgOVKZVfCB avNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731114231; x=1731719031; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1Q4mBwHzI1Zmiy6+Ogfr8sqNUW8HJIFzhPVAIj0jp2c=; b=WU2EPipJ+DWJiQYKF7npy3ae4y1eaZ8fO6rOCYRuvuABZV1P8waSMpHP8goD0iCVtF HEzW/oS1zpabHRmgykeXObENIe3V9cC/HCEJXDjhAgw3gqkpECQEumpJj1lSbsR7QGEy +4faRGHCflPqvoN0MJX6oeH1cUjBQYaJMBIM9hL59E2A4Ec5RM6ZAYYanGzj5iCrzIzp LSk1RMqmtfSpRtNOlqW6jpm4Fqh9exdQrDBiqaKj6J7NBmecwwrLm7soLj9QMD723ujv KbulfwQUKekv21FrBcIbt28YRUozqKZvvbVCLYPiFzh5ItuWkltTNxGgTNuDl34CkO/G qPTQ== X-Gm-Message-State: AOJu0YyB6BpdWF/jldRVz+xvjimgIUsKTBFCUTyrRAGwegKV33JEJnwa lFu6WOiPAHm2MpEll/6D4wOkl1EtkSRa5/TKKpOxc0evC1Xycoet X-Google-Smtp-Source: AGHT+IH/aDsAVPqBY+0JPzwPvf+2Tbjj4Xmb1TyUL3LYkjbNXzC7/uUvOn+K+QiiaD6EjoubzpEoUg== X-Received: by 2002:a05:6a00:4616:b0:71e:4c34:e294 with SMTP id d2e1a72fcca58-7241328ec18mr6081276b3a.7.1731114231067; Fri, 08 Nov 2024 17:03:51 -0800 (PST) Received: from mars.local.gmail.com (221x241x217x81.ap221.ftth.ucom.ne.jp. [221.241.217.81]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72407860aa5sm4399681b3a.32.2024.11.08.17.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 17:03:50 -0800 (PST) Date: Sat, 09 Nov 2024 10:03:46 +0900 Message-ID: From: Hajime Tazaki To: benjamin@sipsolutions.net Cc: linux-um@lists.infradead.org, benjamin.berg@intel.com Subject: Re: [PATCH] um: move thread info into task In-Reply-To: <20241108090826.1898802-1-benjamin@sipsolutions.net> References: <20241108090826.1898802-1-benjamin@sipsolutions.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/26.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241108_170352_288713_F18D1B21 X-CRM114-Status: GOOD ( 15.31 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org On Fri, 08 Nov 2024 18:08:26 +0900, Benjamin Berg wrote: > diff --git a/arch/um/include/asm/current.h b/arch/um/include/asm/current.h > new file mode 100644 > index 000000000000..51b9c4d097e7 > --- /dev/null > +++ b/arch/um/include/asm/current.h > @@ -0,0 +1,24 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef __ASM_CURRENT_H > +#define __ASM_CURRENT_H > + > +#include > +#include > + > +#ifndef __ASSEMBLY__ > + > +struct task_struct; > +extern struct task_struct * cpu_tasks[NR_CPUS]; might be extern struct task_struct *cpu_tasks[NR_CPUS]; # no space before the variable. > +static __always_inline struct task_struct *get_current(void) > +{ > + return cpu_tasks[0]; > +} > + (snip) > diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h > index d9679c911e54..0d3f5d022d24 100644 > --- a/arch/um/include/shared/as-layout.h > +++ b/arch/um/include/shared/as-layout.h > @@ -30,11 +30,8 @@ > > #include > > -struct cpu_task { > - void *task; > -}; > - > -extern struct cpu_task cpu_tasks[]; > +struct task_struct; > +extern struct task_struct * cpu_tasks[]; ditto. > extern unsigned long long physmem_size; > > diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S (snip) > diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c > index 56e7e525fc91..5283035fb655 100644 > --- a/arch/um/kernel/process.c > +++ b/arch/um/kernel/process.c > @@ -43,7 +43,8 @@ > * 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] = { NULL } }; > +struct task_struct * cpu_tasks[NR_CPUS]; ditto. The other part is looking good to me. Reviewed-by: Hajime Tazaki -- Hajime