From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7B33C433E0 for ; Tue, 2 Jun 2020 20:13:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B7A22074B for ; Tue, 2 Jun 2020 20:13:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fk2ULM/S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B7A22074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 47D518003D; Tue, 2 Jun 2020 16:13:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 431BF80007; Tue, 2 Jun 2020 16:13:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 343268003D; Tue, 2 Jun 2020 16:13:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 1F81180007 for ; Tue, 2 Jun 2020 16:13:19 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CF26B181AEF00 for ; Tue, 2 Jun 2020 20:13:18 +0000 (UTC) X-FDA: 76885371276.13.day27_7430f48c22e4c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id A75B018140B70 for ; Tue, 2 Jun 2020 20:13:18 +0000 (UTC) X-HE-Tag: day27_7430f48c22e4c X-Filterd-Recvd-Size: 2353 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Jun 2020 20:13:18 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78EDE207DA; Tue, 2 Jun 2020 20:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591128797; bh=BEbYVk/2xURlo0zmpH1FxsKX4zQIAfJZsVD1cVmMwOI=; h=Date:From:To:Subject:In-Reply-To:From; b=fk2ULM/S0eiy23BUoLDwZeL+eoEcsZonqssfdK5AbZT83TRHkhBsYr7DbfYuxlEtI 8HjsEyL6UCbCKyaJRwcobccIk5r+jVhVSDJWLE+EicvWDjGvUGOlXYVsSm5Okw+73U S8DpZmPE5hVLyNRqprTA7XF24t86FrspTWV0SNxw= Date: Tue, 02 Jun 2020 13:13:17 -0700 From: Andrew Morton To: akpm@linux-foundation.org, linux-mm@kvack.org, miles.chen@mediatek.com, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 057/128] mm/gup.c: further document vma_permits_fault() Message-ID: <20200602201317.k8maBD23t%akpm@linux-foundation.org> In-Reply-To: <20200602130930.8e8f10fa6f19e3766e70921f@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Queue-Id: A75B018140B70 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Miles Chen Subject: mm/gup.c: further document vma_permits_fault() Describe the caller's responsibilities when passing FAULT_FLAG_ALLOW_RETRY. Link: http://lkml.kernel.org/r/1586915606.5647.5.camel@mtkswgap22 Signed-off-by: Andrew Morton --- mm/gup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/gup.c~mm-gupc-further-document-vma_permits_fault +++ a/mm/gup.c @@ -1176,7 +1176,8 @@ static bool vma_permits_fault(struct vm_ * @address: user address * @fault_flags:flags to pass down to handle_mm_fault() * @unlocked: did we unlock the mmap_sem while retrying, maybe NULL if caller - * does not allow retry + * does not allow retry. If NULL, the caller must guarantee + * that fault_flags does not contain FAULT_FLAG_ALLOW_RETRY. * * This is meant to be called in the specific scenario where for locking reasons * we try to access user memory in atomic context (within a pagefault_disable() _