Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3327203imm; Tue, 17 Jul 2018 02:58:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpevOe3yqtX8qYKXvbnKMFceTXI0I/GDvlXDcdCTwpXv7haO1eH6lZA7zH10yXe92SVnHh+2 X-Received: by 2002:a63:4c21:: with SMTP id z33-v6mr910319pga.383.1531821520306; Tue, 17 Jul 2018 02:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531821520; cv=none; d=google.com; s=arc-20160816; b=llGUK/oSb1hq/21Mffu/VWMibRZ+5UZMceRQVkY6AUqDFOQSp36zjAh4xsHFoRuQdW Xch7oqbY40Kxmqaso9rJ3B9rJUmODUxXl4PXdIdKK0WQ9mv7JAA+I8qgtjy7NUC81fdB xnntNJc8NZXzLwGjcKkC29ymRB/aG+8zdhyrGoiatwfV0/N84IvjOGJiQLcc/g3TYZ5O acRtR4RbXbUDjolRijGg/2srDHiYGWigZ70LD1/z9NteK0hYdoK+T/yw4DdA2zbWirZv EX85GRL3xfOdK95on401aTUtyMpYcyY910e02BRL9vfF+S1IcwQPtrB8Judil4IyvxOz UicA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=MNCaT3aMdbpUiEpfzo8iaAQeQf73eJ1kUYeY17CResI=; b=Zm9B5sVvBEeDMjFoCgPyIM2CQ766MHqqZGtgBWo+yaT2Vqcotw0+X6CIlDO9Cn+2Co zX7n+l68gA0LEQU81jrk4i8FuVFtn5nEFP5yzbDhZDu0h7cxl3FL6BAUJa7df7eq60b/ dQ9wp8bJdiBy71pe0419xRAZFaM69L+k7P1X29qSPYJ8Q/pxSQMjnLQVvsmA5qeD5asv WWthdov8Eke8mzS0mc07jfWFqUI+/rzIcA5DcKGlITohrG0kTz/JUTi0AFWIZR56Y6dH ngRH/KdTXooBrwnRW/7gZhxeRRfJ+R+LzK8W5IXZfyaNMMnfU/vWbCKpwEr1pSo35BrG vrug== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1-v6si472678plq.115.2018.07.17.02.58.25; Tue, 17 Jul 2018 02:58:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731125AbeGQK2V (ORCPT + 99 others); Tue, 17 Jul 2018 06:28:21 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729701AbeGQK2T (ORCPT ); Tue, 17 Jul 2018 06:28:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6204A40122A2; Tue, 17 Jul 2018 09:56:31 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.34.27.30]) by smtp.corp.redhat.com (Postfix) with SMTP id 71A28111DD0A; Tue, 17 Jul 2018 09:56:29 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 17 Jul 2018 11:56:31 +0200 (CEST) Date: Tue, 17 Jul 2018 11:56:28 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Linus Torvalds , Andrew Morton , Linux Kernel Mailing List , Wen Yang , majiang Subject: Re: [RFC][PATCH 07/11] signal: Deliver group signals via PIDTYPE_TGID not PIDTYPE_PID Message-ID: <20180717095628.GA27482@redhat.com> References: <877em2jxyr.fsf_-_@xmission.com> <20180711024459.10654-7-ebiederm@xmission.com> <20180716125144.GA18262@redhat.com> <8736wjtetv.fsf@xmission.com> <87bmb7oy94.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bmb7oy94.fsf@xmission.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 17 Jul 2018 09:56:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 17 Jul 2018 09:56:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'oleg@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/16, Eric W. Biederman wrote: > > There are two questions. > a) Can we use the pid of a thread to find the thread group? > b) Will the signal be queued in the thread group? IMO "yes" to both questions, I simply see no reason to change the current semantics. Even if glibc doesn't show the tread id's a user can see them in /proc/$tgid/task/. So I think kill_pid_info() should just do p = pid_task(pid, PIDTYPE_PID); group_send_sig_info(p, PIDTYPE_TGID); again, posix_timer_event() looks fine, but to me pid_task(timr->it_pid, shared ? PIDTYPE_TGID : PIDTYPE_PID) looks like unnecessary complication, pid_task(timr->it_pid, PIDTYPE_PID); should do the same thing. And, I didn't mention this yesterday, but probably the next 08/11 patch can have the same problem. But this is a bit more complicated because send_sigio() uses the same "type" both for do_each_pid_task() and as an argument passed to do_send_sig_info(). Oleg.