Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2618213rwb; Sat, 29 Jul 2023 10:08:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlEKh3XNbL/684uYJVaAhaNsvX5zDTVa8pIUwDD52QEIAD0LQg+TA7NHHBqscjLD9hAeDqNS X-Received: by 2002:a17:903:4283:b0:1bb:1504:b659 with SMTP id ju3-20020a170903428300b001bb1504b659mr4812634plb.40.1690650499261; Sat, 29 Jul 2023 10:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690650499; cv=none; d=google.com; s=arc-20160816; b=VJlQzSnzFQMoUjFtPIFa6uNaFnciURlajOeQMVWc/t20PVucw0ni2GMgLh3GZpQxnk QtG5mKfAfE2OtGWNcaCcEKPTX70ATB5U4h4pXPB5kjJwC4tHcizf5ljcY8Xd2DWOi8B4 IWIkAH7tkuhe/YXsqYxTENNFY0cq+8OYM7VneFu7GOHvtsX2ve8GlzeLWQ02iUKlNpVS 8L8jqn58KNvI3/cnKgpsXUUGyHYCqSqpgZLBnx4YAvPulVLW/66kwEzYMl4pONv0uFY2 5+LDc5+wJSyZ0bqZEF1/xj/S3Gy8VbYCU3tR4jVApOFw6kAj6QFh7Yaw/H931UWRpAQu Zadw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kVw4LWVdll4tRDwniP1YfJ8EssxH9lR3jkgelS2E3rw=; fh=0oerWPJwlKmLU4qFMFkBWrWeUPVPXrKAh6LqhHhQnT8=; b=Ln0Idv41Q+Ymfx+ip4bLitvtiKmNUxZ2ihAvjv7xUOjTU3KCws7ktrEMyWQp0rF306 KegVXlubiBO3+8bFVWwd1myIJ07EzrQ2e2qJ+cl1M+c/ym2Lf2TmyHZGt+7iSL7fJTnk +RWrteHsf/4SHzjXPyetVwpfjGIwX6FEyzWBonKpKaxRcSGXhQqeb2u4oi0IcynBNfVV S8e/jIwXMhWiTQXw/KaBcTXFbg6RpqNeTnfH+8CKWnyvUBu4Ek5JfP4PfPH3lLRMrsdT +TlAaB244ziAOTzDeE0bExIxzKT+DhVv1Rp2GZ/lly8l2AuUGfMS+lvi5GoyILC8ZiaQ 1ryA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=BWuEoZ3z; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a170902684d00b001bbd0358ef7si1144328pln.518.2023.07.29.10.08.06; Sat, 29 Jul 2023 10:08:19 -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=@infradead.org header.s=desiato.20200630 header.b=BWuEoZ3z; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbjG2QHW (ORCPT + 99 others); Sat, 29 Jul 2023 12:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjG2QHV (ORCPT ); Sat, 29 Jul 2023 12:07:21 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A125735A5 for ; Sat, 29 Jul 2023 09:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kVw4LWVdll4tRDwniP1YfJ8EssxH9lR3jkgelS2E3rw=; b=BWuEoZ3zQJHxtH3J46b/qZ3PlB H+ujxYi1T8tVgAD9iyx6wrfrIRvJ0U7rwQmrmheiwcjfbOBDcvvjqOaEE9RTh5BIrOZuKBBY+37Md KM91qNVBRChyWPH1/WptMgZe1TLegUl31ArVB1ZMVKTppGoqrUGnsTqTFPmtM2SIOkJlgusG/yg+R ixoytglBcP7pqJ/9JGcbkQ/VXgrEpAvCPuNQhIkG+5PzFS8dFIMEbJ7TCcTl7KMtAPucBdjg82llU TMeI1d1jP/nyvl0nw390uNKH8mRdbeqq3BOKpyRQZCBgAP/9eZ5/MSwqy6pB3UG3VorH5inbw+9HK /YSAl12w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qPmTJ-009FHA-15; Sat, 29 Jul 2023 16:07:13 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EE78E3006E2; Sat, 29 Jul 2023 18:07:12 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BD2F620CC1F2C; Sat, 29 Jul 2023 18:07:12 +0200 (CEST) Date: Sat, 29 Jul 2023 18:07:12 +0200 From: Peter Zijlstra To: Aaron Tomlin Cc: linux-kernel@vger.kernel.org, tj@kernel.org, jiangshanlai@gmail.com Subject: Re: [RFC PATCH 1/2] workqueue: Introduce PF_WQ_RESCUE_WORKER Message-ID: <20230729160712.GA5697@hirez.programming.kicks-ass.net> References: <20230729135334.566138-1-atomlin@atomlin.com> <20230729135334.566138-2-atomlin@atomlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230729135334.566138-2-atomlin@atomlin.com> 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_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Sat, Jul 29, 2023 at 02:53:33PM +0100, Aaron Tomlin wrote: > The Linux kernel does not provide a way to differentiate between a > kworker and a rescue kworker for user-mode. > From user-mode, one can establish if a task is a kworker by testing for > PF_WQ_WORKER in a specified task's flags bit mask (or bitmap) via > /proc/[PID]/stat. Indeed, one can examine /proc/[PID]/stack and search > for the function namely "rescuer_thread". This is only available to the > root user. > > It can be useful to identify a rescue kworker since their CPU affinity > cannot be modified and their initial CPU assignment can be safely ignored. > Furthermore, a workqueue that was created with WQ_MEM_RECLAIM and > WQ_SYSFS the cpumask file is not applicable to the rescue kworker. > By design a rescue kworker should run anywhere. > > This patch introduces PF_WQ_RESCUE_WORKER and ensures it is set and > cleared appropriately. Is the implication that PF_flags are considered ABI? We've been changing them quite a bit over the years. Also, while we have a few spare bits atm, we used to be nearly out for a while, and I just don't think this is sane usage of them. We don't use PF flags just for userspace.