Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1306050pxu; Fri, 16 Oct 2020 08:49:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJZQz1rgonGlCNJO3RNfOG+DW1GcQAjubf83I0ZaCLxfRX/49e6NEi7YBfQ0p3iymrgsJJ X-Received: by 2002:a50:cd51:: with SMTP id d17mr4543654edj.93.1602863357557; Fri, 16 Oct 2020 08:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602863357; cv=none; d=google.com; s=arc-20160816; b=Mxw9BKhHlwhVSk8eW/xWtxMv4JTIkt5BJj68QujYgITQOmLfrApdFkI03PrAsk4Idr K8kkPJLUl5vcdyKuTvyQz9gaV40tNMzcLOFxz5ByDSQDZjKsDvnjD24VNiKBKT3kyb/N S+1ZudIkefjBzzS6Xf2wJqLz8UeIVGqn9ukThgIxfvTSBUDXegtSrL502tGSMLGOBrpr m4rBr6x53JlCwC0BdMP4Gm6fxUlPLWiGRC8uBZbCAQ0aiJMpQ4yMJDifzPTQ62weyFHc 8NSVzwh84d1g/lyTlYTxA+qodG+wlaA0uoQdyVRVu091pXNHnswC5TfcqiXsaQnxDuqg elWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=LHwdoU5xJRXsIFHp7RY/0oU3V0pjRfbeUgAFb2T1xW4=; b=hh0NOrcIE5TEEmMYFRdkQFEHlNFyfvOERUdaqivQJjh8ZDtC2T9QCGlUNU9xvUudmX nTkbJMTGrCG+ys/635NVLNoGX2gEyi7R7X2sbZkwBqgvDqYecvMKp197wRfsLSqwN6SS h3NljdBVI9VqAIQKb9F+TMa1NR0mfAYSZqaOYpL/plbUCA80rhzwm+qWwvgDdjQx6Jf/ Yq7M6joPUxbyj7HkfQSsJvXDK5akZC2r8zjix7fdkxKdp1FnzKfwSAABr0fOdwyIXEHx SGzylD0pudDHkrDm1pIhSRH84IXKfIPMGaHWBH9oqWbqE3P7akyp9BhP5lErBq2RpgHB XaMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=g6ZCIcDK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si1970559ejn.61.2020.10.16.08.48.54; Fri, 16 Oct 2020 08:49:17 -0700 (PDT) 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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=g6ZCIcDK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408797AbgJPOXD (ORCPT + 99 others); Fri, 16 Oct 2020 10:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394682AbgJPOXD (ORCPT ); Fri, 16 Oct 2020 10:23:03 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE45C0613D3 for ; Fri, 16 Oct 2020 07:23:01 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id y1so1369920plp.6 for ; Fri, 16 Oct 2020 07:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=LHwdoU5xJRXsIFHp7RY/0oU3V0pjRfbeUgAFb2T1xW4=; b=g6ZCIcDKP6R4Jph2TfTQkGUh70t6DdoVqS0y/TZvePe5JAvdrqdYp99+bjdZ5ASIR5 Wu2jxrKI/+NN45SEcyOeKbK12b/qPOWFBETR9q+sTATqpgSbNLOh1nGg3OkJ6LgRQ3W8 XVjhmnUxyRvN7l29NIsiaygfzCWCfCNIHccQqgrrTexiJVuro9dJ+TFCAV46Oi2lJTla haxU9TxVcUcxe0nehaHeIO6BHE1g/B/lQYnhBRu1FlJP19uCqQUjUqjCRCcIeSAQnb8P P76VZXN5kE3biSDHBA/mMrOjqSaYdPvp+SLeutRJ5dU9StA+nDEGigPdkrbu2kPj/ciw xWZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LHwdoU5xJRXsIFHp7RY/0oU3V0pjRfbeUgAFb2T1xW4=; b=Enfzujdt69q669kbfG6B1mjUim3aHvLrvwfoX5zS2zvniwIBQBXNDwzftGXhcg8Zrs vkpNUTl5jZTwFm/Rauz9LhquMAZSBZTD7wkOTebuRd3WNiQHanKQ5zySB6xQ/W8zF0iK F7oHECh1vKMqzSBGrpv32Cz4u1GLYdGgLNsn2G/mJROQO4zptm9kwFGWPn/WN+O4dpeF Le0FxLuHcGppp+7eYQp3vQOlO0T1xJdh5YRijl30W+fsDyV2KKwO+lVQAYeW0jkhpIZS eE6WtuZhy6iiZ5WwPRIvBhWbICe/lSucBsdwVcm4RLq+A4A4UUe2OD+4Yhp7+rFk7osg UTsw== X-Gm-Message-State: AOAM532olvsQKn6FvaPWtLxot/0/dfoAH8Vw8WdPvs7btbWB+eUZaA+H mOUwTlTuTmYX86rbe6hWIDRR5Q== X-Received: by 2002:a17:902:ec02:b029:d1:fc2b:fe95 with SMTP id l2-20020a170902ec02b02900d1fc2bfe95mr4446705pld.79.1602858180993; Fri, 16 Oct 2020 07:23:00 -0700 (PDT) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id 66sm2882105pgd.84.2020.10.16.07.22.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Oct 2020 07:23:00 -0700 (PDT) Subject: Re: [PATCH 5/5] task_work: use TIF_NOTIFY_SIGNAL if available To: Thomas Gleixner , Oleg Nesterov Cc: linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, peterz@infradead.org, Roman Gershman References: <20201015131701.511523-1-axboe@kernel.dk> <20201015131701.511523-6-axboe@kernel.dk> <20201015154953.GM24156@redhat.com> <87a6wmv93v.fsf@nanos.tec.linutronix.de> <87d01itg4z.fsf@nanos.tec.linutronix.de> From: Jens Axboe Message-ID: <5b04c6c1-28df-4810-8382-f9a418d72267@kernel.dk> Date: Fri, 16 Oct 2020 08:22:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87d01itg4z.fsf@nanos.tec.linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/20 8:11 AM, Thomas Gleixner wrote: > Jens, > > On Fri, Oct 16 2020 at 07:33, Jens Axboe wrote: >> On 10/16/20 3:00 AM, Thomas Gleixner wrote: >> I totally agree, and we're on the same page. I think you'll find that in >> the past I always carry through, the task_work notification was somewhat >> of a rush due to a hang related to it. For this particular case, the >> cleanups and arch additions are pretty much ready to go. > > As we seem to be on the same page with this, let me suggest how this > should go: > > 1) A cleanup for the task_work_add() mess. This is trivial enough and > should go in before rc1. No problem, I'll get that posted shortly. > 2) The TIF_NOTIFY_RESUME change is a nice cleanup on it's own and can go > before rc1 as well. Would you mind taking that one? It's good to go. > 3) Core infrastructure (patch 2 + 3 + 5) of this series > > Please make the changes I asked for in the generic entry code and > moving the handling into get_signal() for everybody else. > > So get_signal() gains: > > if (!IS_ENABLED(CONFIG_GENERIC_ENTRY) { > (test_thread_flag(TIF_NOTIFY_SIGNAL)) > tracehook_notify_signal(); > > if (!task_sigpending(current)) > return 0; > } > > And with that you don't have to touch do_signal() in any architecture > except x86 which becomes: > > arch_do_signal_or_restart(bool sigpending) Already did most of this, just need to handle the !CONFIG_GENERIC_ENTRY for get_signal() and adapt the existing non-generic arch patches to this. > 4) Conversion of all architectures which means adding the TIF bit. > > If the architecture folks are happy, then this can be collected in > tip, which would be preferred because then Mostly done, > > 5) Cleanups > > can just go on top. > > Hmm? Sounds good to me, as long as we keep the existing ordering with x86/generic TIF_NOTIFY_SIGNAL support being able to move forward before all archs have acked the arch specific change. Doesn't really change how I'll get it done, and we're mostly there. Just don't anything gated on potential slowest common denominator. -- Jens Axboe