From patchwork Mon Aug 27 11:26:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 10576999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E77B6174A for ; Mon, 27 Aug 2018 11:26:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D558B298B7 for ; Mon, 27 Aug 2018 11:26:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9D1D298D0; Mon, 27 Aug 2018 11:26:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70792298B7 for ; Mon, 27 Aug 2018 11:26:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E0CEA6B4039; Mon, 27 Aug 2018 07:26:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D9DEB6B403B; Mon, 27 Aug 2018 07:26:39 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6DB06B403C; Mon, 27 Aug 2018 07:26:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id 58CE16B4039 for ; Mon, 27 Aug 2018 07:26:39 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id b4-v6so2129196ede.4 for ; Mon, 27 Aug 2018 04:26:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=p42iIwbTrGPV1JR8A37slGiCspSWLnuG5EvrzB1+OHU=; b=FtWEhw/7Br/7nIUgOlKOpSv8pgO/H3yKmpL+iuyY/qDgnXlLBiWM08aMNRqCjeembR b6ghNT967uuRHbmXUufoIYMmMwpEKjPFjYNQw/kfq0+ARzgR+5ySpO6ia2ziu4pP/KnX YjFr6vzvOF5iPWY4lPo5wYjDlH4jbFa3PQmNGnrsipKG+mLJvJIMyDhqmwAt1obFBJU4 fZRvFapDHr7wGrnLOLxUzfr6owmAsnMg/3pZiqQXUeAR+8Dqyt4xEdpS3QE3o9Wbdi5l ptaoi3AT4hpnE72AZO2lPObU96ec0QWUSYYSnEU+MG+rFeJTYNl6e84EpjnuzNZsPwjM 2+9g== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Gm-Message-State: APzg51Al1Sy9Fb6kNgjr1TxIJnbiemz+KafucLlcaEQ3riUu6pl2jp+H V4JJVWuWmominvICUN5EdtLFPvKEBfPRwpJ9GCxIlCgPjPg8l9D4IsTIoMov+sCtN8E1/hdIyDp f9tvMKiCrZh9BZUS0mQvIjo59GFgw06bS/lqTgcXjufLNs3OwmuhrAN2TCPs7+8TN6p98pkVeF1 JrgYfzOtkgW9NOtDEwI/hSGQIxO/Xv98w1pfDDK4fvLz+x6lPm1yD0kAwLzqVqPl4RVb8Vuaqfh rm05skk5plqMe8Sv9eKwpxCDgrr0liMf5S4U/mSrxQHiuzSbJ5xXME0Tmfw4FfEnvEYkzT+i1sJ B+dpCQ9aXW6Vu7XH3H9hiftA7MMRbznIpYw8SREeGvhPkL2iHmImyBYACKTf0ucd0f5tccvOJg= = X-Received: by 2002:a50:dd88:: with SMTP id w8-v6mr16823495edk.204.1535369198873; Mon, 27 Aug 2018 04:26:38 -0700 (PDT) X-Received: by 2002:a50:dd88:: with SMTP id w8-v6mr16823439edk.204.1535369198103; Mon, 27 Aug 2018 04:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535369198; cv=none; d=google.com; s=arc-20160816; b=dt5nPFc28aBpgGoSWZKBvDGJeBOaScE7UAAEr9k/QXrQWp41X/Fn4ojPd2v14aNMdq xBvKcmkwP/nLQaNDmtt5M54KhZiCT/N51F+gC5dBpnc5USVqZSXzTGfBNnisW5WL4v0M LBrDTHzig7zdtHtWPIfAVa6eR2GcL/Kw336TIgu/ZzGIRxcQo5+4BFyloLWB3QNOUQvl PsjVxL1nmxYwLmkY/Awf04yyx9I/e31Kxf8QJZR64Vxuva0/le9/yZ0ZSTZc53oVt/io z9RBuEeOYeScLi9s2jpAq+jeVioQ2pomYAkvUJE4Go+eH1A/t2yUwxcv/UwjZnfXBP3w keRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=p42iIwbTrGPV1JR8A37slGiCspSWLnuG5EvrzB1+OHU=; b=FLCeJXPsgs09yYMmuhpYKLOVnunM1jQj0m6ne2x7q3wgHq88bNICmBeWSeGhO8WsAu lXz7kRi/6FgoqpMSLUe8rZ5gAWh0Gk/HJM6Cflxh1Hc94XqScQTj5KzHy/x3fR2oVFuk fO1GeEUzgFG45eaznmrhtr486Z6L1VmVTgXIrbuAjWxKtDuY7iPViTusW2W5sddjN4mM QZoWQNPwXjY5DDkX9/Y1TZgzUti9xHfLHC1DApugKfVEz6+PjL0aTTr9QzZRdMcXqWI9 3yIIla5ikHdgh9qXxkotTS+/CXMSJZXoQJnjb/nRqxyhmHfVafFnbfO52ch657u6BIsi jasA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m44-v6sor504036edm.20.2018.08.27.04.26.37 for (Google Transport Security); Mon, 27 Aug 2018 04:26:38 -0700 (PDT) Received-SPF: pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mstsxfx@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=mstsxfx@gmail.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Google-Smtp-Source: ANB0Vdb+xhM1ZEfgBmnXBkQhjlEm3WnBtjEDd4mK7LV/prYXDFQUQPWSlF4l3/5siWgQYhK3nC8wiw== X-Received: by 2002:a50:f297:: with SMTP id f23-v6mr16804558edm.40.1535369197863; Mon, 27 Aug 2018 04:26:37 -0700 (PDT) Received: from tiehlicka.suse.cz (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id v1-v6sm6454416edf.3.2018.08.27.04.26.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 04:26:37 -0700 (PDT) From: Michal Hocko To: Andrew Morton Cc: Tetsuo Handa , , LKML , Michal Hocko , Jerome Glisse Subject: [PATCH 2/3] mm, mmu_notifier: be explicit about range invalition non-blocking mode Date: Mon, 27 Aug 2018 13:26:22 +0200 Message-Id: <20180827112623.8992-3-mhocko@kernel.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180827112623.8992-1-mhocko@kernel.org> References: <20180827112623.8992-1-mhocko@kernel.org> 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: X-Virus-Scanned: ClamAV using ClamSMTP From: Michal Hocko If invalidate_range_start is called for !blocking mode then all callbacks have to guarantee they will no block/sleep. The same obviously applies to invalidate_range_end because this operation pairs with the former and they are called from the same context. Make sure this is appropriately documented. Cc: Jerome Glisse Signed-off-by: Michal Hocko Reviewed-by: Jerome Glisse --- include/linux/mmu_notifier.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 133ba78820ee..698e371aafe3 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -153,7 +153,9 @@ struct mmu_notifier_ops { * * If blockable argument is set to false then the callback cannot * sleep and has to return with -EAGAIN. 0 should be returned - * otherwise. + * otherwise. Please note that if invalidate_range_start approves + * a non-blocking behavior then the same applies to + * invalidate_range_end. * */ int (*invalidate_range_start)(struct mmu_notifier *mn,