Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6506912imm; Mon, 23 Jul 2018 20:30:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0r8GzJYGrzwPzKF0VWtvoVZkFqOlgGFmJ/Ot50hkuOZXQ1mPLBbOr2auxKJ94l6NGZY7g X-Received: by 2002:a17:902:758c:: with SMTP id j12-v6mr15274008pll.195.1532403000641; Mon, 23 Jul 2018 20:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532403000; cv=none; d=google.com; s=arc-20160816; b=dzkK0tRyW24Nt0nMeC5YRCk0Ihif2376+lb+8VShKpO+31IGxKfaATRLd6tWSobJTo elt5oPOqNvyVs4L1IeyuZKwRsK5IDrV2tEsWuctRjZLOCJ9UC4yVi5CwmNNuDuHuNYF+ GGM6w4kECoer3QZQZ9kIqUEnp4MXeDL4WE1JPKydOGImd+5rTOmgBAKbBhUDdP6Ro+Ql hAm1szweYjgGwqwyNpqf/73vSKfluEUe9O/gPHudH0ZkGawxqkPAW+TMw/dxpAaxvZFq 70tL0dPknt4gj/+hzjDb9daopiGYYDGLr3n12dokx4k3pfXAavMLFXjlqIz53kGeM6oa v3/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=IoD0KsxMqN33oH6MB5ohF4VqG6T6cz2Oy4BXCv9+0Wo=; b=WRgAgsXVgujaNXRU8z3RmPy7n10zCJGKCNbPq9ArrDf+FHiPHvhEIVDuQQa8qksrti +TgXCbs5TcjuMMDeJg++TUGIWMrZRYrwcQEt6WHdX1RZKXh/i8MB8aGiODa0ReD0uKR5 kGfK13KYrVgB9Jn0N74AGo/ssQmTlUHrq+7IJKgtHpR/nsvxjyo5SOLqeWpmfLmiPZrO dTJSYUYvNWthrU/fEM+bOmU05CsN6qqgeaHNjsIhHfIuiufBMjl2/nZFsJ0vcdJflVKG hQ0puc139i/kXEkco4R0yyAn1Q/0/q0B6FvgyOLpDvNtDYAX2dnn5T3lhEK+GjDkUkT6 Ia7w== 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 v9-v6si10634473pfg.123.2018.07.23.20.29.46; Mon, 23 Jul 2018 20:30:00 -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 S2388185AbeGXEbw (ORCPT + 99 others); Tue, 24 Jul 2018 00:31:52 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:41957 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388130AbeGXEbv (ORCPT ); Tue, 24 Jul 2018 00:31:51 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fhnz2-00032R-Iy; Mon, 23 Jul 2018 21:27:32 -0600 Received: from [97.119.167.31] (helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fhnxY-0008AK-W4; Mon, 23 Jul 2018 21:26:01 -0600 From: "Eric W. Biederman" To: Linus Torvalds Cc: Oleg Nesterov , Andrew Morton , linux-kernel@vger.kernel.org, Wen Yang , majiang , "Eric W. Biederman" Date: Mon, 23 Jul 2018 22:24:14 -0500 Message-Id: <20180724032419.20231-15-ebiederm@xmission.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <87efft5ncd.fsf_-_@xmission.com> References: <87efft5ncd.fsf_-_@xmission.com> X-XM-SPF: eid=1fhnxY-0008AK-W4;;;mid=<20180724032419.20231-15-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/Prr5i69ukkQtEk8V22mSEII/ti0z69Z4= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TooManySym_01,T_TooManySym_02,XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4999] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 196 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 3.2 (1.7%), b_tie_ro: 2.2 (1.1%), parse: 0.94 (0.5%), extract_message_metadata: 11 (5.6%), get_uri_detail_list: 1.78 (0.9%), tests_pri_-1000: 6 (2.8%), tests_pri_-950: 1.17 (0.6%), tests_pri_-900: 0.96 (0.5%), tests_pri_-400: 17 (8.7%), check_bayes: 16 (8.2%), b_tokenize: 6 (2.9%), b_tok_get_all: 4.9 (2.5%), b_comp_prob: 1.48 (0.8%), b_tok_touch_all: 2.3 (1.2%), b_finish: 0.62 (0.3%), tests_pri_0: 148 (75.8%), check_dkim_signature: 0.44 (0.2%), check_dkim_adsp: 2.6 (1.3%), tests_pri_500: 4.9 (2.5%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 15/20] signal: Push pid type down into complete_signal. X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is the bottom and by pushing this down it simplifies the callers and otherwise leaves things as is. This is in preparation for allowing fork to implement better handling of signals set to groups of processes. Signed-off-by: "Eric W. Biederman" --- kernel/signal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index 1ef94303d87a..dddbea558455 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -895,7 +895,7 @@ static inline int wants_signal(int sig, struct task_struct *p) return task_curr(p) || !signal_pending(p); } -static void complete_signal(int sig, struct task_struct *p, int group) +static void complete_signal(int sig, struct task_struct *p, enum pid_type type) { struct signal_struct *signal = p->signal; struct task_struct *t; @@ -908,7 +908,7 @@ static void complete_signal(int sig, struct task_struct *p, int group) */ if (wants_signal(sig, p)) t = p; - else if (!group || thread_group_empty(p)) + else if ((type == PIDTYPE_PID) || thread_group_empty(p)) /* * There is just one thread and it does not need to be woken. * It will dequeue unblocked signals before it runs again. @@ -1096,7 +1096,7 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t, out_set: signalfd_notify(t, sig); sigaddset(&pending->signal, sig); - complete_signal(sig, t, type != PIDTYPE_PID); + complete_signal(sig, t, type); ret: trace_signal_generate(sig, info, t, type != PIDTYPE_PID, result); return ret; @@ -1704,7 +1704,7 @@ int send_sigqueue(struct sigqueue *q, struct pid *pid, enum pid_type type) pending = (type != PIDTYPE_PID) ? &t->signal->shared_pending : &t->pending; list_add_tail(&q->list, &pending->list); sigaddset(&pending->signal, sig); - complete_signal(sig, t, type != PIDTYPE_PID); + complete_signal(sig, t, type); result = TRACE_SIGNAL_DELIVERED; out: trace_signal_generate(sig, &q->info, t, type != PIDTYPE_PID, result); -- 2.17.1