Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1475464pxu; Fri, 16 Oct 2020 12:59:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQWoyzpsBWEFuGfpqehraDzC0zu1j+uJ3lEigtY9d+FNHmTVD83Mq7SBIpYAnkZ4NggWLk X-Received: by 2002:a17:906:e116:: with SMTP id gj22mr5754225ejb.313.1602878391303; Fri, 16 Oct 2020 12:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602878391; cv=none; d=google.com; s=arc-20160816; b=xP8kn8RBZE5soEr2UjsRlNrT1lX91vH975hQBrfKq/VRd9NzoYI4BzwG07jqt2lvAd ezhUz00GeJdNBZ+UvYalbfKoBWT94DO7YkkhpCBVti5N3tcfGwJ3u5Pud/ZZjeAcMvBQ hteHOEoBwmJIERT8QE4EYxf1YU1SrfLuW/6tajpRcxtpPlTT/KzyOCmeHJM13v/rhIeG mnVn/9/exSewHwGWli6kotxTkTZPB/p0N9L2dT41vTh5ctWsw3mnxPQcSiQGse/xRvsr UEYjZVJlLeICby3RZaRcOiVciuaL9kmrouo1GfwjPzce3ptZa+iaWFHiq+22BhdKCuB1 kf0w== 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=lstQ2Z70FH3wyPnp+HqoxtSj5rPcg2/41zwZVIkct8c=; b=kkvBgDqMK5VkwpA3rqLqEPK0zqiK6us/16xlJEXOYTBMAshpkGXaRVKAqNdwJmVUZe qF1ihuc7qotWZD7phb/DEJertJgJv7GxFhPLVdcVL/GFFnETV9aPxbAgQ7m7pkNhnr+M OQzaTCo8+ixDgNBisSXYzZw6AGQvuVM9EXB0C36Ohen2Kc+SUWHqeP/l0xlnpb+5qzKZ N17ToYBBxkloIIEl89avrbQJBnFEewQH4FLpICjy0sZHbIeECxYmpfTit9Ln8QrFv/Ok ILjw6qFSt/Uk1rVBWdFn62ZVl5+iYZzSmAET40tPi3jolsnBbVbOLWNyd1DiVGqRju5I LNZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b="awm5/19U"; 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 i13si2343501edx.106.2020.10.16.12.59.29; Fri, 16 Oct 2020 12:59:51 -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="awm5/19U"; 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 S2390879AbgJPSFz (ORCPT + 99 others); Fri, 16 Oct 2020 14:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390770AbgJPSFz (ORCPT ); Fri, 16 Oct 2020 14:05:55 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA8CC061755 for ; Fri, 16 Oct 2020 11:05:53 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id a200so1922332pfa.10 for ; Fri, 16 Oct 2020 11:05:53 -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=lstQ2Z70FH3wyPnp+HqoxtSj5rPcg2/41zwZVIkct8c=; b=awm5/19UPz2M0E4ycu7+1ioAE+jZd3anvlQXZ4l3NUeA1EpyB/0stdCEy9k2vOoYOw XRnXvNL/Mds0BmVz6azbKku0tTofKH3KuZF3UIXpjWC9otjSYHeNB0tNz8Rb3sY49qHO gYCX7k4V2AlWjLxTTSAcxn8myMPKxFX69iCm+SiXoXZ/qd5P0egrxd0K92qFn1rTcepz zqyD9z1Gd+lWVHpIH2+9nnGZGLI2I0JPYBOLU6X5v9VUhWU/ArSwHM1CIDi4QYTTwbs/ qgMcW/U2OY5q/PvCsLO0SJKXS8lBvh9izMwyHRLlON+1UmNBUNYLec2LnuH9ATcUPhmN sntA== 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=lstQ2Z70FH3wyPnp+HqoxtSj5rPcg2/41zwZVIkct8c=; b=q+oPFWPUkpo8giLX0OAm2OIsV0EkG62nunPc5BcVCvvMCjnjL1WczqNMrBAuLmfGQp RKYGPFtpnPDPtkHSVgrnxDuLnvyi7lHAAP6PlTIxOT3TkOshFSqbGbsz9bADd1b3V0BB hfpTpGSbnhTYbOMB5Nvkx/8uoCrzD2AfesDN+09WHZk+uLnSzPyHK6W4Z8pKmodgOC/l jD5Sxw8FHdw+KOEk1veZso8sLi+VeVsk3fhO+pTEVhSmht36fpsqYzSojWQKSQdITN+Q qfocMDHle7zJUnRwCb+D7anK/JnnzEJ4HmYA7jasxZopdzrKgssK+3ggUM7Nb6WKmEmO GX4w== X-Gm-Message-State: AOAM533+nKCWOwGWCv61+XqDwhWlDkUXDV1Ra8gWPA902dUCwLdEfJy9 0MUSe64hAwC5L3bLaLH6bdxZcg== X-Received: by 2002:a63:3fc7:: with SMTP id m190mr4079513pga.293.1602871552667; Fri, 16 Oct 2020 11:05:52 -0700 (PDT) Received: from [192.168.1.134] ([66.219.217.173]) by smtp.gmail.com with ESMTPSA id j11sm3513818pfh.143.2020.10.16.11.05.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Oct 2020 11:05:52 -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> <871rhyv7a8.fsf@nanos.tec.linutronix.de> <87a6wmtfvb.fsf@nanos.tec.linutronix.de> <20201016145138.GB21989@redhat.com> <1a89eacd-830e-7310-0e56-9b4b389cdc5d@kernel.dk> <874kmuaw13.fsf@nanos.tec.linutronix.de> From: Jens Axboe Message-ID: Date: Fri, 16 Oct 2020 12:05:50 -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: <874kmuaw13.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 12:03 PM, Thomas Gleixner wrote: > On Fri, Oct 16 2020 at 08:53, Jens Axboe wrote: >> On 10/16/20 8:51 AM, Oleg Nesterov wrote: >>> On 10/16, Thomas Gleixner wrote: >>>> >>>> With moving the handling into get_signal() you don't need more changes >>>> to arch/* than adding the TIF bit, right? >>> >>> we still need to do something like >>> >>> - if (thread_flags & _TIF_SIGPENDING) >>> + if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) >>> do_signal(...); >>> >>> and add _TIF_NOTIFY_SIGNAL to the WORK-PENDING mask in arch/* code. >> >> Yes, but it becomes really minimal at that point, and just that. There's >> no touching any of the arch do_signal() code. >> >> Just finished the update of the branch to this model, and it does simplify >> things quite a bit! Most arch patches are now exactly just what you write >> above, no more. > > Except for all the nasty ones which have these checks in ASM :) Actually not that many of them, and the biggest part of that set are easy enough too (just adding the mask to the check). The only exceptions are where TIF_NOTIFY_SIGNAL end up spilling over 8/16-bit, and the particular arch currently uses some mask compare variant that now needs to be modified. powerpc was the worst there, but I'm told a free bit will show up in the merge window so all my powerpc asm fiddling was for naught :-) Only remaining issue I'm aware of in the arch conversions is arm, which runs into this exact issue. Need to check with some arm guys on what the best approach is there... -- Jens Axboe