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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F186C7EE23 for ; Wed, 10 May 2023 15:45:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 056C36B0071; Wed, 10 May 2023 11:45:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 006A26B0072; Wed, 10 May 2023 11:45:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DEA0E6B0074; Wed, 10 May 2023 11:45:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id CC70F6B0071 for ; Wed, 10 May 2023 11:45:24 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8A30C402EB for ; Wed, 10 May 2023 15:45:23 +0000 (UTC) X-FDA: 80774769768.28.36B4E93 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by imf08.hostedemail.com (Postfix) with ESMTP id 47A8C16002B for ; Wed, 10 May 2023 15:45:18 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of ebiederm@xmission.com designates 166.70.13.233 as permitted sender) smtp.mailfrom=ebiederm@xmission.com; dmarc=pass (policy=none) header.from=xmission.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683733519; a=rsa-sha256; cv=none; b=Ryyaofz3dtgWHPwbrlLIDbTF+bYFNh+8qsCgnQ3OKs11E35Jc8LaVw+/YqGonSnx+hpJxz 68IYpaokvH8uPxPIHM4KpRd3JH83uxMufL6HQf19pB/hfC7MAKwdy1pbQ0xRohK41puNfo /2qLZQse+lEDZKmmhLnMDSyAue+iyY0= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of ebiederm@xmission.com designates 166.70.13.233 as permitted sender) smtp.mailfrom=ebiederm@xmission.com; dmarc=pass (policy=none) header.from=xmission.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683733519; 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:in-reply-to:references:references; bh=AZQ5QFdiepP+fbCyzmmEDC9xmFJqBtNShtY9SYIo08o=; b=dURIXt0Y05QrWvnZYrtM8+ZkL0A9wyJKCnzMhX30qk7aZWbzNdJmCOm1Tdd4jdlxMEKT7u i/eTJ8/KoEPvm+Uiy3CoyyPP933tZEHVayT5h4uki3Ks1wMGjvBRG8FaMSucCK78PZo0Kr K4uFK4JNtkXqzDRUw6umDdt4pPa8Zlk= Received: from in02.mta.xmission.com ([166.70.13.52]:38472) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pwm0C-009f3m-Tj; Wed, 10 May 2023 09:45:16 -0600 Received: from ip68-110-29-46.om.om.cox.net ([68.110.29.46]:51364 helo=email.froward.int.ebiederm.org.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1pwm0B-006uPF-RI; Wed, 10 May 2023 09:45:16 -0600 From: "Eric W. Biederman" To: Huacai Chen Cc: Luis Chamberlain , Andrew Morton , Kees Cook , chenhuacai@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20230509104127.1997562-1-chenhuacai@loongson.cn> Date: Wed, 10 May 2023 10:44:43 -0500 In-Reply-To: <20230509104127.1997562-1-chenhuacai@loongson.cn> (Huacai Chen's message of "Tue, 9 May 2023 18:41:27 +0800") Message-ID: <87ild0w5qs.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1pwm0B-006uPF-RI;;;mid=<87ild0w5qs.fsf@email.froward.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=68.110.29.46;;;frm=ebiederm@xmission.com;;;spf=pass X-XM-AID: U2FsdGVkX1/6Az45sWJkYuh4JpbrMsGatRFJzZ3Jt1c= X-SA-Exim-Connect-IP: 68.110.29.46 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH RFC] kthread: Unify kernel_thread() and user_mode_thread() X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) X-Rspam-User: X-Stat-Signature: eiuxtrif9jw667bi74bnpn11ixrg9x61 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 47A8C16002B X-HE-Tag: 1683733518-677907 X-HE-Meta: U2FsdGVkX19E1Xj9gmIyRyegqzG8gSOWpGvb67V13fpDeV6SmJo5FP5PtYUGJ6Vy2Zj2ZCQ1r+aPOTTMKGKkRgMy3LdP9WXM51VeRtzyNEoS9yqpkFORjaQsi42GLvJNMW4kslXMK/U9F053K/vm84QMHuPwOzLahwaY3SjScXXWnIk8t2mr4AEvNOFe3D+wQnVlcZcR/zAswVmZlu84qX5yxJv2USm4xpK6mYDhGfObqSOCypd7ROsYev1EkhTD0kqss8J0T5/uv3w2Os0j5b2tyHl5qsklyL0SMei1EKICq9O3nEkO2krXu1J3MzJdHEVwZIYz3FwDE9JKGWtyj98IGmLo2SlU1Rd+J1foOKXSQi/DRCQMKYxH9f9oyMG3DOCfwC+R5dr9W2QQg1GMg3+y5CLVgj3PzX0sLyH2AV2GZ+6ap9ywaAKlAkpD7QM5gEJNSaITOozXg9Wz4n0qCBTVA5bzKc1KTsE1TAKTj6A0G9u0z5jXUPSi2V1kmUE+ZeF6mYDRbU9a4b/N6wQExsRtq1N64F3DfztIp094nRcLie2t3b2CSyfHjCg//qfIipCal/MQz18oUfm1wZuudgr1MbiFuZHk3yfLGDl4GdXCN486/dGlWAyIcJ9yefFJZUqfAmPzIkEqDZL4LXQnJzT81rFXM7w4oNB4Rg5rU+accHdFPqugwVNfdl4PblhGDyoby49TMeFFc0nnvq3U4rNCBmHuOHXNeEzj3/dKPlPtz8a7s5q+cKDZgj9zYpZqNjsxmn7wKA7x4ljtKwrHHEnRb3mRdXTwZO3IZJPu6eSAQgy0thYvS7Rp2/06NgDZVYLidTp1thEppqtjPosyZdsVrOUuAEumrPyhC1qnHKwP9a15RVb2lBxwvesaYPsqiSpJ29SiXsfWGOtqijz3hgVDuqVkrT1ndsG5zhG8jrxW89r/s2eqpKHs4oijltz3FEFpHxiYbtEQZD8HIHB PJsNbbOE gMoo4M39g3GC+g+Qm2/eRaOL/HQ8F884JsoBOLGpKTGlrHgs4VOKXwFqxgqtzGMSy2c6s 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: Huacai Chen writes: > Commit 343f4c49f2438d8 ("kthread: Don't allocate kthread_struct for init > and umh") introduces a new function user_mode_thread() for init and umh. > But the name is a bit confusing because init and umh are indeed kernel > threads at creation time, the real difference is "they will become user > processes". No they are not "kernel threads" at creation time. At creation time init and umh are threads running in the kernel. It is a very important distinction and you are loosing it. Because they don't have a kthread_struct such tasks in the kernel are not allowed to depend on anything that is ``kthread''. Having this a separate function highlights the distinction. Highlighting should hopefully cause people to ask why there is a distinction, and what is going on. > So let's unify the kernel_thread() and user_mode_thread() to > kernel_thread() again, and add a new 'user' parameter for init and > umh Now that is confusing. Eric