Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5183180rwd; Mon, 12 Jun 2023 00:54:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6OrR9Yv3oxfEcQJGfcQEdlopr5tXAieYJn5KcBMC5rIcuJr8uzEy5skTuHrrEiKKk/UAb0 X-Received: by 2002:a54:4504:0:b0:394:2c43:c3f3 with SMTP id l4-20020a544504000000b003942c43c3f3mr3287755oil.59.1686556477654; Mon, 12 Jun 2023 00:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686556477; cv=none; d=google.com; s=arc-20160816; b=VU1uomC7KZyXMCgYAYyZWB83U+/CQteGO8hru3no/R1XoGy155lL+eEhASDGZs5oDv f4xM66py88c00qbUSAL35FP3Jz5jAHDK4+31vIaUbD+SZSxy6MQ4NlS/eWEDGmOeBBBT eJl6sI74ATEEQ2sE06QIsLFcjxax1xUfTnDHHjMrWpnCxQmQBuaqzDubVeCX8ACOHsHi ttsxkbsZldfSmY5AXaSIZccux7dRbQhvFGPFl0BQJPAyuqzP6jZc+soQdujs37tgUIM7 DOYe2sKIrXkcNBEBEqNHyHojL7IzWiYGsFlumGi3UDNZa8x/1udTS4O1gXFtnEiz1gYh 4SMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=UOZWia0uZeGvaQi3MK4YR+I/hZw08QaJJFpFJXADn8E=; b=M0y8qV1LiLJOYnmVyK50WfM4tzaQ4oR6HsisNUOLSYleWAKtOUZ7Hxp4v20L45TuaE /hKbt+a8hC57OofLWSDYxztNPbeqNxg5mUVr8y7ItZCAVWXQ1vvc275kRKRjTPKtFPvP GV9cOHIFPFFGV2XY0LQCwEn4ttfXiG8Ga4kzYp7he9ZcZxl1mUBpOJdAchwWtuwt26+s h4wrg0E2RE2b2TuvrOg2yKq6fOiC7pSexzmpy/inrn3z7EpVg3VpLHGsGtFH+2mHZ4NS a/NZEMzJFA1lTXo3AMMOhaTlK4XfWJVSxiySD26vG/S72t3rJMTP2o+trTNqfNKKpGs/ wQ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="pkfLEU/M"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot10-20020a17090b3b4a00b00256c4209ba5si8504434pjb.158.2023.06.12.00.54.25; Mon, 12 Jun 2023 00:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="pkfLEU/M"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235824AbjFLHtV (ORCPT + 99 others); Mon, 12 Jun 2023 03:49:21 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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