Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3414795imm; Fri, 20 Jul 2018 16:42:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnIfWUp4Oeou6JpZFGgxdcN2v5ldV8hji0WQ4ymwKpTxbLwIoSMSJspn6TlTlllYWQFgQc X-Received: by 2002:a17:902:da4:: with SMTP id 33-v6mr3828493plv.193.1532130167371; Fri, 20 Jul 2018 16:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532130167; cv=none; d=google.com; s=arc-20160816; b=hGflWwQK5wasPNT7uW39KsmhuzBplKxl18zcDfp4C/4SIC+8SqQjC0IZW6/xWqazF3 ZsxEDFbCYVjP06oCPyNHIbWtUDlU3G8OPiy1omAdwnRGu53CfU6wt/Dx2+xFzGw373vc L8OpRO9MDw3DBj+DOGbAq51evESMSTDr57oRU8YA6JDoq4nydqtSoI7VjX66BISeNjO5 0faMeW8KMNQt0sYfDrttc1FuT1vjqOPZOuOMuI7LOVO6nXvydn2RQbKsSPRmW+BRNMzM Znc7kePQJexE2K3y2M8VM6xgx90rOYF8TqhKZBQm2YBnhdyldgYqzqZ12J+gR+Ttz25I eOoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=wW4+V8uyn8XmvTo82l7MOE1YQjTiwKkx3hK8HCuhzi4=; b=FACgB3Iy5JIz9yT8F/1deY4pZsu7g1cEOUvB0VEI6KivcBa7fjrZ2olyUFlGZ2FLJw hI+p/e2aIqZ4LwaWzDIAnRFREpFcoFC23Sao7Wuw67vo4O1KyOluPxCIheNepA8ufKmH elF/aITQ00Aw8oaYsMqTuBtQ/0CzDDGoNpHPQhH4WsOFfCZNdQYy+OLEFn56mMQuufGK Xsys0povq4L3jQTzM8VdPu3O0eRDuJQu7WmtSfKWP/BSOPnyWUbyNSdX6Q8sB+E4GOcl mWcRjFmbnQ/uNg9qFyOZHuX2o36yXI1bDwYuZXddA8Lrqg3b76PqnbS29zNvDvv+AWpY wKpg== 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 k6-v6si2688624pgb.446.2018.07.20.16.42.32; Fri, 20 Jul 2018 16:42:47 -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 S1728229AbeGUAcO (ORCPT + 99 others); Fri, 20 Jul 2018 20:32:14 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:41942 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727533AbeGUAcO (ORCPT ); Fri, 20 Jul 2018 20:32:14 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fgf1r-0007RY-VR; Fri, 20 Jul 2018 17:41:44 -0600 Received: from [97.119.167.31] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fgf1r-0003Lk-6N; Fri, 20 Jul 2018 17:41:43 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Oleg Nesterov Cc: Linus Torvalds , Andrew Morton , Linux Kernel Mailing List , Wen Yang , majiang References: <877em2jxyr.fsf_-_@xmission.com> <20180711024459.10654-7-ebiederm@xmission.com> <20180716125144.GA18262@redhat.com> <8736wjtetv.fsf@xmission.com> <87bmb7oy94.fsf@xmission.com> <20180717095628.GA27482@redhat.com> <20180717101811.GB27482@redhat.com> Date: Fri, 20 Jul 2018 18:41:34 -0500 In-Reply-To: <20180717101811.GB27482@redhat.com> (Oleg Nesterov's message of "Tue, 17 Jul 2018 12:18:12 +0200") Message-ID: <87pnzh79w1.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1fgf1r-0003Lk-6N;;;mid=<87pnzh79w1.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+b+t5/ZaM4s72pvvQc7neT7239l48z6BE= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sa02.xmission.com X-Spam-Level: *** X-Spam-Status: No, score=3.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, XMNoVowels,XMSubLong autolearn=disabled version=3.4.0 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 1.5 TR_Symld_Words too many words that have symbols inside * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4983] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***;Oleg Nesterov X-Spam-Relay-Country: X-Spam-Timing: total 422 ms - load_scoreonly_sql: 0.13 (0.0%), signal_user_changed: 4.3 (1.0%), b_tie_ro: 2.6 (0.6%), parse: 1.57 (0.4%), extract_message_metadata: 5 (1.2%), get_uri_detail_list: 1.79 (0.4%), tests_pri_-1000: 7 (1.7%), tests_pri_-950: 2.3 (0.5%), tests_pri_-900: 2.1 (0.5%), tests_pri_-400: 26 (6.2%), check_bayes: 24 (5.7%), b_tokenize: 10 (2.3%), b_tok_get_all: 6 (1.3%), b_comp_prob: 3.2 (0.8%), b_tok_touch_all: 2.1 (0.5%), b_finish: 0.92 (0.2%), tests_pri_0: 340 (80.4%), check_dkim_signature: 1.45 (0.3%), check_dkim_adsp: 6 (1.4%), tests_pri_500: 10 (2.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC][PATCH 07/11] signal: Deliver group signals via PIDTYPE_TGID not PIDTYPE_PID 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 Oleg Nesterov writes: > On 07/17, Oleg Nesterov wrote: >> >> 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(). > > perhaps it can simply do > > if (type <= PIDTYPE_TGID) { > rcu_read_lock(); > p = pid_task(pid, PIDTYPE_PID); > send_sigio_to_task(p, fown, fd, band, type); > rcu_read_unlock(); > } else { > read_lock(&tasklist_lock); > do_each_pid_task(pid, type, p) { > send_sigio_to_task(p, fown, fd, band, type); > } while_each_pid_task(pid, type, p); > read_unlock(&tasklist_lock); > } > > this way we also avoid tasklist_lock in F_OWNER_TID/F_OWNER_PID case. I like that. I updated that code in a different way but that looks more elegant and I think I will incoporate it. > To clarify, it is not that I think any sane application can do > fcntl(F_OWNER_PID, thread_tid) but still this is a user-visible change > we can easily avoid. Agreed. I do think Eric