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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A87D8C352A1 for ; Tue, 6 Dec 2022 08:00:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A82A18E0002; Tue, 6 Dec 2022 03:00:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A30BA8E0001; Tue, 6 Dec 2022 03:00:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91EE38E0002; Tue, 6 Dec 2022 03:00:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 86AA28E0001 for ; Tue, 6 Dec 2022 03:00:17 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 5327EAB2AC for ; Tue, 6 Dec 2022 08:00:17 +0000 (UTC) X-FDA: 80211133674.02.6694A0B Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf06.hostedemail.com (Postfix) with ESMTP id B67D018000B for ; Tue, 6 Dec 2022 08:00:15 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=FyQJxSH3; dkim=pass header.d=linutronix.de header.s=2020e header.b=1UULGtv2; spf=pass (imf06.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670313616; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=E1Z9m454oxebSwU8j1D3Js8F7RvRn+TS/GqdCK3hooo=; b=Lt16WrQdPJdQwL7TB1xx7mm6yfxSPdpgfZjMozZp+38Nxnvf/By9RIh+xbTrUXp8SfGe4c c9iB8KBdmfBMvWvY1LRE1Wf4O07PKOHnYL+9wiaRexEM1HHqdWr0QIzq1T7tQiKQnZZqAG V44En+W9AkvZhVkyQ5Pndm/rV1gohLY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=FyQJxSH3; dkim=pass header.d=linutronix.de header.s=2020e header.b=1UULGtv2; spf=pass (imf06.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670313616; a=rsa-sha256; cv=none; b=xZbfi75vGbdtPKnv0Ux1zKtTe9wSeocFAsvjpftFiUhJ9goArTvG1InZ50nVdoz288Hiw7 PhJSP9SKTD12/JgRSd2HvjAnOjRx1P/iBKGxfXvGcoyjWhjljgAuDdEYmDmUMuiuWni/LS MTvwiP90wbKL7u6eL6iI56j69d2VSEk= Date: Tue, 6 Dec 2022 09:00:10 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670313613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E1Z9m454oxebSwU8j1D3Js8F7RvRn+TS/GqdCK3hooo=; b=FyQJxSH3DQiGYGb+OkB3n5my3UxmPFrB7m2S1DjkNXHHs5414nuxTvAk+oza4KaWRj7w+Y indmx29RRgWBQnUBB40QGi86TyzjWj211bTd2M7haGG7NNQkXf7d24ImsaSGCkrjFBptCX cv9Hd+bWAbpp4mBFTJCC02cp769JTD6YcVLIY7I5bQXIYUi+nov1zMSzr6+GP2q1KTTr8O J64dIBR5ptBijjhjGNDUqAplNFVF4HgVkdDVppw+YmA2WvIziIBxktmp6UnvsRmDmbv8ld LmNWmjAQh74+l7qXwIUVoA1d/gSAJ71RBhx9cHIjHVDUbX+fhZKn2lpDXihA4w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670313613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E1Z9m454oxebSwU8j1D3Js8F7RvRn+TS/GqdCK3hooo=; b=1UULGtv2BOiwDV+6PKDwV3YZmqiT0MDnc5+12x9nWzLYRjn8JWtsJtT1t/fCt7EiNavpYg 6PTxV4FOpUVU6zCQ== From: Sebastian Andrzej Siewior To: "Fabio M. De Francesco" Cc: Jonathan Corbet , Andrew Morton , Ira Weiny , Mike Rapoport , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport , Peter Zijlstra , Thomas Gleixner Subject: Re: [PATCH] mm/highmem: Add notes about conversions from kmap{,_atomic}() Message-ID: References: <20221206070029.7342-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221206070029.7342-1-fmdefrancesco@gmail.com> X-Stat-Signature: 5me5s31xwm1raqo6neqtrcxeugz3cncu X-Rspam-User: X-Spamd-Result: default: False [-0.00 / 9.00]; SUBJECT_HAS_UNDERSCORES(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[linutronix.de,none]; R_DKIM_ALLOW(-0.20)[linutronix.de:s=2020,linutronix.de:s=2020e]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; BAYES_HAM(-0.00)[39.97%]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_SEVEN(0.00)[11]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[linutronix.de:+]; TO_DN_SOME(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: B67D018000B X-Rspamd-Server: rspam06 X-HE-Tag: 1670313615-92505 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: On 2022-12-06 08:00:29 [+0100], Fabio M. De Francesco wrote: > diff --git a/Documentation/mm/highmem.rst b/Documentation/mm/highmem.rst > index 0f731d9196b0..9523e92299f6 100644 > --- a/Documentation/mm/highmem.rst > +++ b/Documentation/mm/highmem.rst > @@ -100,10 +101,21 @@ list shows them in order of preference of use. > (included in the "Functions" section) for details on how to manage nested > mappings. > > -* kmap_atomic(). This permits a very short duration mapping of a single > - page. Since the mapping is restricted to the CPU that issued it, it > - performs well, but the issuing task is therefore required to stay on that > - CPU until it has finished, lest some other task displace its mappings. > +* kmap_atomic(). This function has been deprecated; use kmap_local_page(). > + > + NOTE: Conversions to kmap_local_page() must take care to follow the mapping > + restrictions imposed on kmap_local_page(). Furthermore, code between the > + map/unmap operations may implicitly depended on the side effects of > + kmap_atomic(), such as disabling pagefaults, migration, and/or preemption. > + Such conversions should be changed to make explicit calls for those > + requirements. Furthermore, code between the kmap_atomic() and kunmap_atomic() functions may implicitly depended on the side effects of kmap_atomic() namely disabling pagefaults or preemption or both. > + [Legacy documentation] > + > + This permits a very short duration mapping of a single page. Since the > + mapping is restricted to the CPU that issued it, it performs well, but > + the issuing task is therefore required to stay on that CPU until it has > + finished, lest some other task displace its mappings. > > kmap_atomic() may also be used by interrupt contexts, since it does not > sleep and the callers too may not sleep until after kunmap_atomic() is Sebastian