Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp640036yba; Wed, 15 May 2019 07:30:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcFPiJDUhnV87DKfi3QeAIv+J+S23jPR/7Xkil3pr55lESzUd0yWQHIxcwhJb2H+PqBog1 X-Received: by 2002:a17:902:5e1:: with SMTP id f88mr43203581plf.226.1557930629234; Wed, 15 May 2019 07:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557930629; cv=none; d=google.com; s=arc-20160816; b=FTMMy9Qunu2D1kSWReuYzqVIkO2u3XCzijMHYlNMK6JDVp5ZEpIWRCIz6dNF+nYv7z SqD6nVE0jxtq1BbSiQPbx1POKnVF7RNqFhDiocIIueLUbPDt4tGVwUKmdnlTHiVMVGxn c/P4gef0EImKrUotTrsy0HXR0xJwI/2TZA98eQxXhMSqwcSppla87mWtPforTcGsyHw8 z7XRqJwUszyGuLoqxPs0OKU0nf/Nnyq+X4lCY0XWN0XUAi2aTEfJMKADpJRlWX3hiQL7 EE/ka+Ed0Yy/l/+o9lI47YS+35qXqKrk+HVJH5K88pIx8MleiqPRZ8hahDOnnizyZLpc zxww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Hzs6yrUCFcHOdFexksEy5jtAZllxhwQ36OKZUIdddQU=; b=qBvRcewVv+qKEHrrpMuCYX2KvXVHSbW8NGqWVoxzB26DkLEeXsBGhJX9LvIJVSDSsd UhlTA9xKudgLVf9AEOpDctWUTmqydkjTdwOeWzufgcrX22aeGLAoz+9BiOA7WbAjA/xx VMzxHgvsy+APiU4WYlANDupldtCTcvDaeNleXSmJ2WXQYPyoTI8jDwoShr1phcbseoQm zz9N/WhkMlnosCVmBEb1tVlQTLB+yd1JFpqYNFJgd0wgo/S+FCcLIAuY+WKdIuPxqwwC L1gdxNor2PPameCJbdYam4nKef0KVuMVpBOuYwqt/vT8jSh3jKiGGFIsiBUA+6gRDn2E 7y5Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3si1934407plp.260.2019.05.15.07.30.14; Wed, 15 May 2019 07:30:29 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727763AbfEOO2d (ORCPT + 99 others); Wed, 15 May 2019 10:28:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53169 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726911AbfEOO2d (ORCPT ); Wed, 15 May 2019 10:28:33 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 139C88553A; Wed, 15 May 2019 14:28:33 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.159]) by smtp.corp.redhat.com (Postfix) with SMTP id 147181001DD7; Wed, 15 May 2019 14:28:31 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 15 May 2019 16:28:30 +0200 (CEST) Date: Wed, 15 May 2019 16:28:28 +0200 From: Oleg Nesterov To: Konstantin Khlebnikov Cc: linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: use down_read_killable for locking mmap_sem in access_remote_vm Message-ID: <20190515142828.GA18892@redhat.com> References: <155790847881.2798.7160461383704600177.stgit@buzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155790847881.2798.7160461383704600177.stgit@buzz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 15 May 2019 14:28:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -4348,7 +4348,9 @@ int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, > void *old_buf = buf; > int write = gup_flags & FOLL_WRITE; > > - down_read(&mm->mmap_sem); > + if (down_read_killable(&mm->mmap_sem)) > + return 0; > + I too think that "return 0" looks a bit strange even if correct, to me "return -EINTR" would look better. But I won't insist, this is cosmetic. Acked-by: Oleg Nesterov