Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp693574pxf; Thu, 1 Apr 2021 11:04:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfYpMNYZc3iA7t9emAT+0FgLmw5UvrgaEb+LxU795uXDO2zWQFleUJrOsMp2jwQdSbUwx/ X-Received: by 2002:a92:b09:: with SMTP id b9mr7610457ilf.257.1617300278144; Thu, 01 Apr 2021 11:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617300278; cv=none; d=google.com; s=arc-20160816; b=fH/yIbEd34F4ShyxXNkPOO4Ao07HQcpsZa3hrj22q9CXheCFUzQR/Vv+kMwnyJeNUC kvhpu+kwZ3xwQbEZoIurK26R9zA94Zj4xPWr7E0k6o3OcvQjSQbNYApLFguwk2yYFXRc wbo7nwwAwng8runm1+zw1hRsR4afTcDBpEAbkLRw8v08jlfNVZps+yr+RuWKjDwl2K1K caGskKkby9uAHM6T2YVSvlDBwyHOTtQqBAhnIqnqA3kKes9iSzL8k8EdNus8ir84A45E 9sbRiiRhpMCk2PJIt/A9O6SVbYWdN/3LWLdSfVgp2QlvNXTwO09VBva+nXGai3TSZ68P Ehlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=9An728KlZVjFf0+wENS6eedafMqAahJG4Eij/X4oC/A=; b=zWN1oy1cZXM2iQkI8EssFXZILxzP7p/Tyql08nKW7QmljSJNZoa7Zb6BrusUyY/jyw FMkdqIk6tgY7S4s7Pmvg6PqI5lDrwnu8ZBzhhX6WFhMtz0EzPN9w+gzpr+0xJsqIsnh4 cEtSvhXD7f0xyj//Qnwfb8TeNMv0VJq/PxLxRdWnPwIP+fGlBlJneoC8E2sUGtVPK96J ueLw4od9gIVecffxM0LfUHhXbHS+5hMEqONYAZJul5Te56fpxdgbc40ImB0I6IRCJ6l6 QxCvz5QtHhwujtWbU0qzPU/ojUljpzOusxr7aS7yfHffXXfkHmzIoLsNzgnsyOvHIoRr RBsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samba.org header.s=42 header.b=qsotVAOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si5008193ioq.100.2021.04.01.11.04.23; Thu, 01 Apr 2021 11:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samba.org header.s=42 header.b=qsotVAOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=samba.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237658AbhDASEC (ORCPT + 99 others); Thu, 1 Apr 2021 14:04:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236375AbhDARsZ (ORCPT ); Thu, 1 Apr 2021 13:48:25 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4399FC00F7C9; Thu, 1 Apr 2021 08:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Date:Message-ID:From:Cc:To; bh=9An728KlZVjFf0+wENS6eedafMqAahJG4Eij/X4oC/A=; b=qsotVAOsAg8OcFq9zC5lgMb9GG MurbuwzIaErbn6IKjPavhYlcQzwF3VkGyyEeE5qZ7Z5Rh1nT2gqMB3fe6VIe4jGiTxGk2Hb2jrMxY TPd0KHj+62YMLei1/cpln9i8/osy4zGPYFVH5/ZXKBmuvpJXGE18p3jHCV0ouuRcdEX91zs8mZMLB B5Yjzj6ZgxySQMFUEW1q9361RLEtX5Nxsw8GzqhM0Yu8F6R8HtME2Wl9w4xYxFytlYeEqE+tmsBsi JQsEirprZ0bVIRYgnWSX/fE/+Rpc6MmMW+uCodPy0fLyD4qEwkFhUcTB+fKeBoOcULcE0yp/Ohy5m Dj4jlWmc6rk4anGQsw/kDht1WQwF0Qpe5T1G8r4ts4yK9ROwpfmo7x015b4OYbuuhT9hXxm+J5LDU ARXpwmeARIXcuUP8/ktzb9754M3xWrfplDaBqnd1EWZ6qHjpbB81AOSKiAAuW6IAbvxQw9/Pd1JIU teYLJXz18h/IPJJHsgm+UNcO; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim) id 1lRysz-0007XZ-En; Thu, 01 Apr 2021 15:05:29 +0000 To: Alexey Dobriyan , Christoph Hellwig , Jens Axboe Cc: Andy Lutomirski , Andrew Morton , LKML , Linux API , fw@deneb.enyo.de, io-uring References: <20210322075310.GA1946905@infradead.org> From: Stefan Metzmacher Subject: Re: [PATCH] Document that PF_KTHREAD _is_ ABI Message-ID: <5992461c-1aad-3ba4-47d6-4dad10b6903a@samba.org> Date: Thu, 1 Apr 2021 17:05:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 31.03.21 um 21:23 schrieb Alexey Dobriyan: > On Mon, Mar 22, 2021 at 07:53:10AM +0000, Christoph Hellwig wrote: >> On Sat, Mar 20, 2021 at 10:23:12AM -0700, Andy Lutomirski wrote: >>>> https://github.com/systemd/systemd/blob/main/src/basic/process-util.c#L354 >>>> src/basic/process-util.c:is_kernel_thread() >>> >>> Eww. >>> >>> Could we fix it differently and more permanently by modifying the proc >>> code to display the values systemd expects? >> >> Yes, do_task_stat needs a mapping from kernel flags to UABI flags. And >> we should already discard everything we think we can from the UABI >> now, and only add the ones back that are required to not break >> userspace. > > Sure we do. Who is going to find all the flags? I found PF_KTHREAD. :^) > > More seriously, > > /proc/$pid/stat was expanded to include tsk->flags in 0.99.1 (!!!) > > Developers kept adding and shuffling flags probably not even realising > what's going on. The last incident happened at 5.10 when PF_IO_WORKER > was exchanged with PF_VCPU for smaller codegen. With the create_io_thread(), the impact of PF_IO_WORKER becomes more broadly visible and userspace might start to look at it in order to find the difference between userspace and kernel io threads. (I also think it should actually be renamed to PF_IO_THREAD...) Jens, what do you think about that? metze