Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp523626ybi; Fri, 7 Jun 2019 12:00:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5KDkxvAfuVo0gkSPg6GTU2SaOvIAexqIfqdWX0Xlmb/6XVSmAf9Nkkh3paMsNmBIYBs14 X-Received: by 2002:aa7:8157:: with SMTP id d23mr60684758pfn.92.1559934031970; Fri, 07 Jun 2019 12:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559934031; cv=none; d=google.com; s=arc-20160816; b=VpNI2/Ha+QZExtJjgRxk1Zy5ekLsYdW176X2iTHqxswMMF6G+uhIL6uJdgI44BR6kq BOWPZauPh81sApnCvsENVbXk1mZtfBtULGZNkSSi6dbuupx8UtYZyLvb5Wjidqwbpgi6 ZWsCwqkgEd7yvIdo6DQ3wiy5AY38Zei6EHfCjXDqSd1YYFchToKeeFA/OScn/eVzLysU K3yIUaBgO9DkNlE3BD604VZ4vXG2Cc4waAUcQFzwiZa1dnzd2p1SvGx81Vf8VgxE3zcH VGM8ZBVBn3G3Gg81LolB8w75L9e6kLxDyiX1CL3Sguk37JvBG3YJLHEbMX1d7jmOT6H2 AQ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4AvJFyeYPhoZ4OqCr1dphehPV0ub1oVxmCWbJKgWsTI=; b=RGLN6hO/wnqZW1SlU5LkxoVvaRPEGeKxvxNhhvkGE0fpQfq7CIaBHdZwxPGWOo+BsJ zkZ4tws/sgQnsEMj2HnOv3L3BYJABjs8bgnZSOIJZNg8yCrH+WSPu4lo2nbr9lavz++t XTDCjy4jh+RRqZ+McEnQlWDcfwqUsKWNZF567jlJCxV0F9a5EqtvwIwSGykrMTWfWFQa XQI0V5Ctmgf/mpi7Rd+wwlDRwxRKEurvGRL6nDXNFBTpoWXCc8Fu/OvM7wgJ6xWEV9xY xFYsyyM6eGrAEwsxAh225LTPPYMr4em1hkk73bHeuxL5DDEp2EXMpGYmBY/cnAgLqrCi R3cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="d315/RM0"; 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 z4si2812066pgh.334.2019.06.07.12.00.15; Fri, 07 Jun 2019 12:00:31 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b="d315/RM0"; 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 S1731001AbfFGSLM (ORCPT + 99 others); Fri, 7 Jun 2019 14:11:12 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:42727 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730336AbfFGSLL (ORCPT ); Fri, 7 Jun 2019 14:11:11 -0400 Received: by mail-lf1-f66.google.com with SMTP id y13so2290878lfh.9 for ; Fri, 07 Jun 2019 11:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4AvJFyeYPhoZ4OqCr1dphehPV0ub1oVxmCWbJKgWsTI=; b=d315/RM0DaMH44my3nNzmVmEhTs+nmHZuuQf+pKqz9YU+VjDMhvTt+Yvh514Ss3VZ3 osVtbUYyVCFBmdkSg2kW5jq84b2tec/7sH0g88lborkaDjwnEQCiquJ2Gjh042t4qJRK O0Z2hoSc9g3XgDPMu2hQ/afW7OGSyKvzIuScc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4AvJFyeYPhoZ4OqCr1dphehPV0ub1oVxmCWbJKgWsTI=; b=IweXGZxTUxHm9CnQFvgyIpXsdclsQxRHGDCo4Sduyb/Woq3DVqOdh5iRj0DNWyUYM+ I3FAhRCFGLFXJ3WWs6arSqTYiqXa6phCJ9KKrbGbhdAA4Zu2z3Kxr0vng6PNfQcxLfqA RL5xzvnyGoHqtiFuSTIkHNd80diHwgIRaCkpRM0p+qIVmXqUbObe7v4FzIIodwW1/DXR pnmVcmRBhBa1CO2ro203h/bTdBJJqeAZTYS4qfdhl3u1QKR1WFQNrmzxZROroRZQYYb/ hl9aPuEP3zw64PvoPgSxAIMD/rKX1DtKmQb+sWytZEAL4GEvGnXa88Jd+RrdSkJy1JGi 3cbQ== X-Gm-Message-State: APjAAAXduAUM6W5sApCLp9KdecB97UOzwme+l6Oce+c0pwF9LNx4ft+r qrMSBZH+37x6hShdky9zf3RGO2typaA= X-Received: by 2002:ac2:597c:: with SMTP id h28mr3605570lfp.90.1559931069458; Fri, 07 Jun 2019 11:11:09 -0700 (PDT) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id b4sm527602lfp.33.2019.06.07.11.11.09 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2019 11:11:09 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id y198so2319734lfa.1 for ; Fri, 07 Jun 2019 11:11:09 -0700 (PDT) X-Received: by 2002:a19:2d41:: with SMTP id t1mr27328138lft.79.1559930729175; Fri, 07 Jun 2019 11:05:29 -0700 (PDT) MIME-Version: 1.0 References: <20190522032144.10995-1-deepa.kernel@gmail.com> <20190529161157.GA27659@redhat.com> <20190604134117.GA29963@redhat.com> <20190606140814.GA13440@redhat.com> <20190606140852.GB13440@redhat.com> In-Reply-To: <20190606140852.GB13440@redhat.com> From: Linus Torvalds Date: Fri, 7 Jun 2019 11:05:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] select: change do_poll() to return -ERESTARTNOHAND rather than -EINTR To: Oleg Nesterov Cc: Andrew Morton , Deepa Dinamani , Linux List Kernel Mailing , Arnd Bergmann , Davidlohr Bueso , Jens Axboe , Davidlohr Bueso , Eric Wong , Jason Baron , linux-fsdevel , linux-aio@kvack.org, omar.kilani@gmail.com, Thomas Gleixner , stable , Al Viro , "Eric W. Biederman" , David Laight Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 6, 2019 at 7:09 AM Oleg Nesterov wrote: > > do_poll() returns -EINTR if interrupted and after that all its callers > have to translate it into -ERESTARTNOHAND. Change do_poll() to return > -ERESTARTNOHAND and update (simplify) the callers. Ack. The *right* return value will actually be then chosen by poll_select_copy_remaining(), which will turn ERESTARTNOHAND to EINTR when it can't update the timeout. Except for the cases that use restart_block and do that instead and don't have the whole timeout restart issue as a result. Linus