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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59594C7EE25 for ; Mon, 12 Jun 2023 07:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234736AbjFLHtX (ORCPT ); Mon, 12 Jun 2023 03:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235528AbjFLHtB (ORCPT ); Mon, 12 Jun 2023 03:49:01 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A76252127; Mon, 12 Jun 2023 00:48:31 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686554477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UOZWia0uZeGvaQi3MK4YR+I/hZw08QaJJFpFJXADn8E=; b=pkfLEU/MgFNQ54EayAioJlP9N8TyiCWvDcN6D6/B9fmeqv9DT4fvtuHNhMO+X8HMn6cXnB S+qW/cWO6ALsGO1Z3uz24b4Y8xUOZRbwfZfa67PnOSM+4g5vzpr3PV9vrLn1GWfuWpQtNM 4B81WtGHFLZAvmE6OpB5alAv8F4tmQctTrwGpgeQmXRhwtzGgD960t3PP24jlZ4jLAcGAw aWHUssKtx1lHHPy+6hAOxWKGmu04LuNrp6Xw/sPSut3+x2UPuvWqAokamjc1rHvRWcNi12 1A6F1KgirLx0YKg48Z6Ha0Mc5yUTA2GQqUy4gptOGm4+hbvjufLvFoq9JXp6Qg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686554477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UOZWia0uZeGvaQi3MK4YR+I/hZw08QaJJFpFJXADn8E=; b=En1O6ZsvXHIR0ygmiNd0s4GIQMRdb4Yfn6zSEk0XxkTA377ymwyw8ivAhWs4SEfoWQ0n1J z3p7FhX4/3/GzxBQ== To: linux-kernel@vger.kernel.org, Andrew Morton Cc: mm-commits@vger.kernel.org, mcgrof@kernel.org, keescook@chromium.org, chenhuacai@loongson.cn Subject: Re: + kthread-unify-kernel_thread-and-user_mode_thread.patch added to mm-nonmm-unstable branch In-Reply-To: <87352x22jc.fsf@email.froward.int.ebiederm.org> References: <20230605231056.16BD1C433D2@smtp.kernel.org> <87352x22jc.fsf@email.froward.int.ebiederm.org> Date: Mon, 12 Jun 2023 09:21:17 +0200 Message-ID: <87wn096t8y.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 11 2023 at 14:59, Eric W. Biederman wrote: > Andrew Morton writes: > >> The patch titled >> Subject: kthread: Unify kernel_thread() and user_mode_thread() >> has been added to the -mm mm-nonmm-unstable branch. Its filename is >> kthread-unify-kernel_thread-and-user_mode_thread.patch > > Andrew. > > My fuzzy memory thinks Linus asked for the current split. Correct. It was in a discussion about a nasty security hole due to a race in the original code which did _not_ have the distinction. > Plus this change just obfuscates the code making the most important > detail the argument to a boolean parameter. Meaning you have to have > an interface that has only 3 callers memorized to even begin to make > sense of it. Right. Losing the clear distinction of the function names is a horrible idea. If at all this should at least keep user_mode_thread() and kernel_thread() as inline wrappers around a common function. Just blindly unifying code is a patently bad idea. Thanks, tglx