Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1438940pxb; Thu, 4 Mar 2021 11:16:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVUC5twF8Eu2FYvgdd2fdcQyGal42lCU4p+vKATQqaRxKVYOVahW3lnEbNKhPBTB8/DDCp X-Received: by 2002:a17:906:b14d:: with SMTP id bt13mr5920141ejb.407.1614885369722; Thu, 04 Mar 2021 11:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614885369; cv=none; d=google.com; s=arc-20160816; b=L5hAISPLWTsv3D9z/gxe4Gq/BswhunbaykdQppTNmgAjEYtVeroEKUljdx6hJn7FLx LuDlv/+G0y+pMvaYYuWmKmc/bT/tC8Zm2ExguZgQWdcTbdTBDn5w+PfusqVYrayv0Qz1 6SZ2gpdDoVtnTyB1c3/4Cx+FXacfuMkPP6G3Nec/9dQhlgbsPqWXpjo0nUtinb4fs8uT z7P9iWqk0GoMNfEPcoyEezSHNV7XGZan0uf3wLViVo9AU/pQb5eoF1rB0oWG5FOCfK1L AkQUGNlmApJnOxU5Q5LWqW3TY86Qh0+fiIG+z4783Bi04Kk3oUTsXMUlwHayQBTp1DCm biGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:cc:to:from; bh=x7Qo2qINiFPHmUezgiXbrLqASZTMShJ9rv/idCUQ6cQ=; b=vmCcSFejMOed+aC71zxV2kSSSQjSjrMqu28buHScMB6TaXCJST327EVUzHRfSEwd6S XAvGxX5hzgSQA8iNjXPQGGIx8h9DIg8WazxkrHiFVxP/0efonRD8h8usZ0VIIuwMeIkf ouofqaoxla31syngYTAjQkPcgUlIPle0qNlqeGh838teGwsoiCcFuebfCuY0voCO5vB7 h3cbAa+hPs/jSQuFYTr0l+sswfmrR7zmk4zRyws+w5Jzo3X7hdg8WSBgcED/WR9Fmyo1 ml4YodCSDIl7yrbLeHOOvBGD/nHgQqSnBJ6Xiu3ox/6ppCKUpUF7dUB24a8GGcEhlS9+ tSRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si220783ede.264.2021.03.04.11.15.46; Thu, 04 Mar 2021 11:16:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237036AbhCDTFX convert rfc822-to-8bit (ORCPT + 99 others); Thu, 4 Mar 2021 14:05:23 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:55716 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236228AbhCDTEy (ORCPT ); Thu, 4 Mar 2021 14:04:54 -0500 Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lHtGb-00ASEp-EP; Thu, 04 Mar 2021 12:04:09 -0700 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=fess.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lHtGa-002EOH-DL; Thu, 04 Mar 2021 12:04:09 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Thomas Gleixner Cc: Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Oleg Nesterov , Matt Fleming References: <20210303142025.wbbt2nnr6dtgwjfi@linutronix.de> <20210304081142.digtkddajkadwwq5@linutronix.de> <87tupr55ea.fsf@nanos.tec.linutronix.de> Date: Thu, 04 Mar 2021 13:04:08 -0600 In-Reply-To: <87tupr55ea.fsf@nanos.tec.linutronix.de> (Thomas Gleixner's message of "Thu, 04 Mar 2021 16:02:05 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-XM-SPF: eid=1lHtGa-002EOH-DL;;;mid=;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18R52oqQneu5np0N/5Uc8Jp1bSLt8e3Wso= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa06.xmission.com X-Spam-Level: X-Spam-Status: No, score=0.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,XMSubLong,XM_B_Unicode, XM_B_Unicode3 autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4992] * 0.7 XMSubLong Long Subject * 0.0 XM_B_Unicode3 BODY: Testing for specific types of unicode * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.0 XM_B_Unicode BODY: Testing for specific types of unicode * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Thomas Gleixner X-Spam-Relay-Country: X-Spam-Timing: total 511 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 11 (2.2%), b_tie_ro: 10 (1.9%), parse: 1.46 (0.3%), extract_message_metadata: 17 (3.4%), get_uri_detail_list: 1.90 (0.4%), tests_pri_-1000: 15 (2.8%), tests_pri_-950: 1.29 (0.3%), tests_pri_-900: 1.05 (0.2%), tests_pri_-90: 210 (41.2%), check_bayes: 209 (40.8%), b_tokenize: 11 (2.1%), b_tok_get_all: 7 (1.4%), b_comp_prob: 3.6 (0.7%), b_tok_touch_all: 183 (35.8%), b_finish: 1.08 (0.2%), tests_pri_0: 240 (46.9%), check_dkim_signature: 0.59 (0.1%), check_dkim_adsp: 2.4 (0.5%), poll_dns_idle: 0.50 (0.1%), tests_pri_10: 1.97 (0.4%), tests_pri_500: 7 (1.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] signal: Allow RT tasks to cache one sigqueue struct X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas Gleixner writes: > On Thu, Mar 04 2021 at 09:11, Sebastian Andrzej Siewior wrote: >> On 2021-03-03 16:09:05 [-0600], Eric W. Biederman wrote: >>> Sebastian Andrzej Siewior writes: >>> >>> > From: Thomas Gleixner >>> > >>> > Allow realtime tasks to cache one sigqueue in task struct. This avoids an >>> > allocation which can increase the latency or fail. >>> > Ideally the sigqueue is cached after first successful delivery and will be >>> > available for next signal delivery. This works under the assumption that the RT >>> > task has never an unprocessed signal while a one is about to be queued. >>> > >>> > The caching is not used for SIGQUEUE_PREALLOC because this kind of sigqueue is >>> > handled differently (and not used for regular signal delivery). >>> >>> What part of this is about real time tasks? This allows any task >>> to cache a sigqueue entry. >> >> It is limited to realtime tasks (SCHED_FIFO/RR/DL): >> >> +static void __sigqueue_cache_or_free(struct sigqueue *q) >> +{ >> … >> + if (!task_is_realtime(current) || !sigqueue_add_cache(current, q)) >> + kmem_cache_free(sigqueue_cachep, q); >> +} > > We could of course do the caching unconditionally for all tasks. Is there any advantage to only doing this for realtime tasks? If not it probably makes sense to do the caching for all tasks. I am wondering if we want to count the cached sigqueue structure to the users rt signal rlimit? Eric