Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3450698imm; Thu, 17 May 2018 08:58:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo1nrZJ4aDXWF5QF1b6+/lbqYAUoYGDsyCVBOYoBTz7170vEzhiMCYxD/6RSTNgAfeBkeu0 X-Received: by 2002:a62:c050:: with SMTP id x77-v6mr5675878pff.67.1526572733125; Thu, 17 May 2018 08:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526572733; cv=none; d=google.com; s=arc-20160816; b=hl3bsCw0P/zTtN7oFq1uebD2sW0vqvrb52sUMQfYi7L74ZEF/hYzHLON9Yy90QINiR ch1qSyBu8FjGsn3Au8Odt7VArQNObC6jaYM5lbDne06pJGIc2zKc6nwtBxgWS4qCHoxv P2PKQHahKRR2d3h0Yo3LDtxt1+9QEKYbsLZ05AnmoslU1BF0oN4L1/mseyPdEIHgd/mk U5OwSHu3Ayt1ny+TF8q4rLX/wmsKYBvuyQfg51wg1hIFMno/yV3nf5QfV9GCEHrS7e7Q tURHiChLPzMAi3ok4FVCiNOCJscKGkhCGhyUtpiAc/lXigP//YIyYuzAMrpn4tsfJdQc 2Uew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=TOFxHruHbrcHzAx/p7f4m3EXvRa1ydI4Bfw4EoYOoBY=; b=eH9UlxK7Q+IOQxDQGbAlHUpGAxc6dcid4KDXVcNHvnl7iVkMO1njj2aehUtB9olf0+ r2UjsqHi3K1Vk95HwZi5uq6qlatTb5obs6YRHjovHIyswtDA9KWdoXaW0QLHUk80JyLn l0wcRQ2VSNh5iakflTW1DnIxOpnKl82JfbayHgIUOnJ1ZtUQrAl3ZhaCvzgkrHuhnC08 V1TqIxBTZ38oVKT0o57vTdrMTmy/2Jc3aPaf33/4o0VCdeHm4Hfii/rTSU/Wl7a2rPiS W5IFCFHghNtkHiGVK8sYLDsT0zv28GOQZNtMfui7xQR9DWsnbFH4QFdgNzQeB7HbqFcU DUdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22-v6si1178987pgh.407.2018.05.17.08.58.38; Thu, 17 May 2018 08:58:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbeEQP5T (ORCPT + 99 others); Thu, 17 May 2018 11:57:19 -0400 Received: from gardel.0pointer.net ([85.214.157.71]:51740 "EHLO gardel.0pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbeEQP5S (ORCPT ); Thu, 17 May 2018 11:57:18 -0400 X-Greylist: delayed 414 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 May 2018 11:57:18 EDT Received: from gardel-login.0pointer.net (gardel.0pointer.net [85.214.157.71]) by gardel.0pointer.net (Postfix) with ESMTP id 61862E80B0F; Thu, 17 May 2018 17:50:22 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 05E6F160AF8; Thu, 17 May 2018 17:50:21 +0200 (CEST) Date: Thu, 17 May 2018 17:50:21 +0200 From: Lennart Poettering To: Alexey Dobriyan Cc: tj@kernel.org, torvalds@linux-foundation.org, carlos@redha.com, luto@amacapital.net, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] better visibility into kworkers Message-ID: <20180517155021.GA5480@gardel-login> References: <20180517074202.GA3091@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180517074202.GA3091@avx2> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Do, 17.05.18 10:42, Alexey Dobriyan (adobriyan@gmail.com) wrote: > > The kernel APIs for all this aren't really good > > though, and I always was reluctant to check for PF_KTHREAD, as that > > flag is neither documented for userspace, nor available in any > > userspace-accessible headers. However, I wanted to tighten this a bit, > > and hence we now define the flag in our own code, as it appeared to me > > otherwise there was no chance to ever make this fully robust. > > PF_KTHREAD was introduced in 2.6.27 and its value appears to be stable > since then. I think it should be retroactively declared part of ABI > otherwise people will continue to rediscover that all other means do not > work. Yes, I agree. And it's exposed to userspace after all, though not symbolic, but simply as flags value. > Empty /proc/*/exe is second best option for systemd and it's only one > system call. That doesn't really work for us as readlink() on that requires CAP_SYS_PTRACE, and we need something that works unprivileged, which PF_KTHREAD does. Lennart -- Lennart Poettering, Red Hat