Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1330225pxu; Thu, 8 Oct 2020 08:55:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGRDAn8ic71J7ce1jOFHC1hBhZekxgkbQozd8sw5IBGugLs/GRQyu0Od6d/w2B6tyCzdx5 X-Received: by 2002:a17:906:3c05:: with SMTP id h5mr9372679ejg.70.1602172510578; Thu, 08 Oct 2020 08:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602172510; cv=none; d=google.com; s=arc-20160816; b=qAHlYZoAiaaNi5km0qIvcYyOx9sHL28xxL5UMXigbHyincgjh49aI1EiuZvdpUhpAg gyLOLkm9YwGME0MUNxs9s2ViL0/ZSqNsp7ttyUt+8FqiGxR04Is1kO+DmnuBNDcmcbJW 6f+X/VLturBXEo8tUkaixhJPSA5sJ95W5Qmqo1WG76LvVuSzPsI9FUF2WI+lMko9zCI9 aZH0PCQ7RMyyMAOWGUWiAYGyrJ/yJ/YBK3bFA9LL4ATCXQWQ9d+5t4kUcR1dNrsAWzvi x2PASIxwKenpYKG35Qbrj/GKONtnYdycGMRq3AN8JNMsZu4v0vI2S1osE4J/SzvpFinb l6Nw== 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=LyHt3eHI3FIkwwqq5kMI+6YnXizAfuknUcS9blSJyB4=; b=NJHdMuCcLjXT62SRlt1TlmfQcAykISjJ+7qbe++8jrsMbhsXtfKel0jSjYP3TRfPlu 2uE+yMTm0Az12Kai/pWg+T1+zhJ8tlvqq6nQvgix/7kKN0CvF3Ddtp9lBUY9234VYbh8 z0kL0dID5YjKQU98N9CE3o2EIEw3zk1I9nySldKMXPxF5wmXgeVYjHzWKix2o4ONIZF1 rpBGvy6TuJ81D6qD/IvxAxmZZbXAFpoA/KDFQ0GbW2KpIcc53FTtfaCm3wRAlaMlPnxG fERx2xkDfN3f215RMMJyGWsCQEllMHpQ8WYH2XahHxpfQvpXm8xhDDleHWjtF3gZWQUD sclQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=kV9TEZeZ; 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 bs17si3952340edb.391.2020.10.08.08.54.47; Thu, 08 Oct 2020 08:55:10 -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=kV9TEZeZ; 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 S1730616AbgJHObg (ORCPT + 99 others); Thu, 8 Oct 2020 10:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbgJHObg (ORCPT ); Thu, 8 Oct 2020 10:31:36 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9138C0613D2 for ; Thu, 8 Oct 2020 07:31:34 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id o17so773733ioh.9 for ; Thu, 08 Oct 2020 07:31:34 -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=LyHt3eHI3FIkwwqq5kMI+6YnXizAfuknUcS9blSJyB4=; b=kV9TEZeZrl54zCtQdEFyo/yZFKFfOeG7Mi0bVbLpjOIokEixlWwymnVtOLEi5be8cF NkiwTHlf4wCr4lmHW+9rAdCWTdNk7PEH1fXU7tmNjNLHXYgelJov8SwRtHdBS3Xco9tb 2ldlTtse6/Rnj7bZh5Bj69FUO6VCbkEix47Iub0KIkWK1ZW+EBlKrgkMvdu7HmxWa9Un AkQwlcmt2Vv7SrxLE+52k9waAMGfePYmKjuZDltsGW7ZRED1kSe1an4EOYIWX0fgwPn5 P3QD9zF1RrbOohbOaNKIH81jFDGBva2VemnU9ryEQw/b63JjTtiadk5kdVUcE8g51wZZ 1oDg== 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=LyHt3eHI3FIkwwqq5kMI+6YnXizAfuknUcS9blSJyB4=; b=ucjas47gQPCYX9+GwRqW85gHs7GRXZfzBCPA9zf/g6UYob+VP0CzwcHfQy+QvEyJTp SM58i/6lOjyMafWWLsvrzDQZKZSM05GpD5lTA38hcAJv/G2Aosjro9BvgvGlf50QBHwe nh1h/Q1CXLnQAdqkZSClfEYYyloyEJf7ftJL5yi4x0v3mBkXoMqJ6+gu7z6eSPxlMfYy yMb1h04/AU++8TbLvAhdpOK63YCpBTN80wLuQDj+SnupoSoQvX8COf2aTxbkBNdqne+T L5TAp19Q4i1OrSyOLFCbQKR3pt0paOm6hEV8Z5kOScpl3psUr2xpEYXGOfbNIxVmksf2 Nt0w== X-Gm-Message-State: AOAM530KfUQO4KcIQeNAeFHFH7n/EALZ1bu25DmKZKEU6P3ed0nmb+uz e2kWhf0wyFMjINGxN7952JQsUg== X-Received: by 2002:a6b:ef0e:: with SMTP id k14mr6117594ioh.131.1602167493818; Thu, 08 Oct 2020 07:31:33 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id r16sm2763624iln.58.2020.10.08.07.31.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Oct 2020 07:31:33 -0700 (PDT) Subject: Re: [PATCH 3/6] kernel: split syscall restart from signal handling To: Oleg Nesterov Cc: linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de References: <20201005150438.6628-1-axboe@kernel.dk> <20201005150438.6628-4-axboe@kernel.dk> <20201008142135.GH9995@redhat.com> From: Jens Axboe Message-ID: Date: Thu, 8 Oct 2020 08:31:32 -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: <20201008142135.GH9995@redhat.com> 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/8/20 8:21 AM, Oleg Nesterov wrote: > On 10/05, Jens Axboe wrote: >> >> Move the restart syscall logic into a separate generic entry helper, >> and handle that part separately from signal checking and delivery. >> >> This is in preparation for being able to do syscall restarting >> independently from handling signals. >> >> Signed-off-by: Jens Axboe >> --- >> arch/x86/kernel/signal.c | 32 ++++++++++++++++++-------------- >> include/linux/entry-common.h | 14 ++++++++++++-- >> kernel/entry/common.c | 11 ++++++++--- >> 3 files changed, 38 insertions(+), 19 deletions(-) > > Can't we avoid this patch and the and simplify the change in > exit_to_user_mode_loop() from the next patch? Can't the much more simple > patch below work? > > Then later we can even change arch_do_signal() to accept the additional > argument, ti_work, so that it can use ti_work & TIF_NOTIFY_SIGNAL/SIGPENDING > instead of test_thread_flag/task_sigpending. Yeah I guess that would be a bit simpler, maybe I'm too focused on decoupling the two. But if we go this route, and avoid sighand->lock for just having TIF_NOTIFY_SIGNAL set, then that should be functionally equivalent as far as I'm concerned. I'll make the reduction, I'd prefer to keep this as small/simple as possible initially. -- Jens Axboe