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 38306C4332F for ; Thu, 8 Dec 2022 04:30:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87B178E0003; Wed, 7 Dec 2022 23:30:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 802F48E0001; Wed, 7 Dec 2022 23:30:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67C308E0003; Wed, 7 Dec 2022 23:30:55 -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 559578E0001 for ; Wed, 7 Dec 2022 23:30:55 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2B1734058B for ; Thu, 8 Dec 2022 04:30:54 +0000 (UTC) X-FDA: 80217863628.29.F9F2FAD Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf09.hostedemail.com (Postfix) with ESMTP id 735E714000B for ; Thu, 8 Dec 2022 04:30:52 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=m9AnZWn2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670473852; 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=9J9egNIrKEH6gSzkm3nX2FAWcpfOqH1vV2sOBbvy3uA=; b=rxo+lsGfy8WE4wjEav4yXwfe8snxoESAXL2FMs6Jg1jVyOusQHdyQLruWpnYn1fcrWgSKc m2BQmeo1hbkrTYXGzdwoi99Yl/STOHNUpxs9GMccE/t5BC1NbzXhJ6GNQsGSu659BOVnsa jvZqfXscNYmjnHz2rLNF+EtHGHeL7Lg= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=m9AnZWn2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of bagasdotme@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=bagasdotme@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670473852; a=rsa-sha256; cv=none; b=lMb8y2cuQ8EYDaGMBH+WlyZ53RZV500IFFsM/zP1TreGdoKVCJFOb24OXw85HnmQkNvorX hKOnXMmQb2NaQ75K38vzyImzUuWVanDI1YgTe1KgwZkL9LGzZ2cY+W4jhNm7bYYWL+5tSr 8bO/VHs4JMVUlSbC4lVN3ARCGMyM8L4= Received: by mail-pj1-f42.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so3427344pjs.4 for ; Wed, 07 Dec 2022 20:30:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9J9egNIrKEH6gSzkm3nX2FAWcpfOqH1vV2sOBbvy3uA=; b=m9AnZWn2bXXlYNXjsXasmSIsh5Otzjx5suQ8Kasdj7k6PTAU2nSpSDncsFbSNeLW0d oJUmZeiEUXtxvlBmyp5Gfv7Lo84QIJogUMhhqKYQhgehWz1cCdkoNt4yhZxX4xdzbuLZ lQMfnab43pn+FuZWe35KEsPOu36pB1KxWGMERST0/dgUhDnaL/JVsfnVPZeN42UP1i9N hQQEDxJUNAz85RBeHA8fWa2Ns2NfNAaX/TgwW/EOzdHH1d0AxfuGY2uLelvCR9m7pNWZ LMPRrLGK+prqaDoV2ca/RFe2NIZq6LErkYIluJTS2BpUWsbLAkZJ4HkcVEHDSyj5MtNv pDUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9J9egNIrKEH6gSzkm3nX2FAWcpfOqH1vV2sOBbvy3uA=; b=WVUGJ81RtEpgSrzlzCKBUxjv+4yldk2eWHb3sGKMiWwxYXHv/23geOxjcO7+kOx0tk d8+d0xXFwddW3RtB8S5hpb4ZtmnrmowWnUDABGpmoIlX+x4Hr7tXlBgWFQDeJGjcoYiJ AYmiTK8+FmKFw5xscAG7VNRmq5TAU37bljOSItURTQG+KMHHRO2oLZEnr7hYnrD3nYcZ VwEQSSK4OQqCn91rybOvOl1jA3cZjsxCsHneVxET6YwGZPQCwO6YZJ/kpWC2kYwvFvJT iGGnJ46Sx8mO4dgF6/1gFdr1h+0LLXCKOlP/5XKtDiVs8HuExJfEo0No2d/PMGxI8QO6 gKxA== X-Gm-Message-State: ANoB5pkzf23cyWB1gFinfpAXHOouAWJ5RwNMlWR/0EU9jf49uPoZgIA6 ydKL9BXeuxoOopNi0eJoV0Q= X-Google-Smtp-Source: AA0mqf4b/w2tfxh6Bt45IcnxJSN1AW42YagPzrv+A0xo3DWyW4qu4HLTNwJ3zuR5fST3xxff/313Og== X-Received: by 2002:a17:90a:df91:b0:219:8464:84d5 with SMTP id p17-20020a17090adf9100b00219846484d5mr31336058pjv.9.1670473851281; Wed, 07 Dec 2022 20:30:51 -0800 (PST) Received: from debian.me (subs02-180-214-232-11.three.co.id. [180.214.232.11]) by smtp.gmail.com with ESMTPSA id m17-20020a63f611000000b0047685ed724dsm12190249pgh.40.2022.12.07.20.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 20:30:50 -0800 (PST) Received: by debian.me (Postfix, from userid 1000) id 2F1021002F3; Thu, 8 Dec 2022 11:22:37 +0700 (WIB) Date: Thu, 8 Dec 2022 11:22:37 +0700 From: Bagas Sanjaya To: "Fabio M. De Francesco" , Jonathan Corbet , Andrew Morton , Sebastian Andrzej Siewior , Ira Weiny , Mike Rapoport , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Mike Rapoport , Peter Zijlstra , Thomas Gleixner Subject: Re: [PATCH v2] mm/highmem: Add notes about conversions from kmap{,_atomic}() Message-ID: References: <20221207225308.8290-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DpcXuOK9+sW5uRJK" Content-Disposition: inline In-Reply-To: <20221207225308.8290-1-fmdefrancesco@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 735E714000B X-Stat-Signature: fkag55qude8fohonxu9hpjg6z7s1b145 X-HE-Tag: 1670473852-816419 X-HE-Meta: U2FsdGVkX1+bLRT795y54u7E1/iJBUETh/NEWM5sVRriO7P/SxWqz+g3ANXVLtrl1cAiG8YztRjDZlY9k2ncE5FZQs2NF3F+5a/cTlkAwBLiMqjAumd8cLpRyIkC2OIw/PTTcSGXN0kg6cvJNwphAidiDK6J7smhf68wN4d0Q+rxjvjy73dj+84yryX3tz3A8a1J1y1pJoYiVkx7YhubW0IJSRQLeIdK2/meaRM9JG/peXsSuCWXSSNgZOTPiZzDPpvxFeFMyaEkuyA02tnokNa3aXmX9j8+NTZ+5gsMujVFEQp+iRBK6wGxOlmfKH6aYYH9IufuSeGj1RJbYJGDF9ysAtBXVDfnbi9mbFbN6bilkxPcBDK9AMIPGNM8pJDtib+AGEwz4fNWZw/0MXYcKxOpgHn4uLtkA2yNxj2k5N6F5scbPBpBpi/vuNUCnX8MBqhxG8NJnxYSo/1Gy+FasfSslzyIPq67Zsq1nOABADgc06JJvbPd9le5voNvvb3Yt4Q1i7mjsRKtaGgJ8NOaJnmsl+Son9jKMlzhMZ5eTOb3iL2AIZfqHYViP1D8X5kO77Zdqnoql9nl5ctV5LanM1QZv6EyNcUXFy80aufCobw6D5MPv0Ho311S9QRMXhyttkgTzLnrYq66TT84vdpnuMpCUt9IRGS94fnjT1QT05D6UcvyMAB4NW5Ekw6otTaH/YQdaZQpQF2MqLqPgH7sgzX1qQVy4pvRUnDxDIqn0rWMBCXmASU4H89yJDDLlw+nyIRPpozmw7Vnf89wsFAXBv1dAFt8PLGk3M0d0C65TfsascjqoS77mJjSNgTQIlzkS6r6aKjUFz9b3yIUG2O1aE26sZOn3/brBcjjUoYLcxYLHLclDgBexBxn6l6UJeJa+5BhylWf92IU1VsAbslmT3xWwItI2wXH0e4UL1f6Nifwhv4KpyRCZ6MJnFMduBbWBMjC8BjYBofEHfRwdwB D7xi/XG7 r3DrEq5KTrdYfdAn0wZnlppOq9St77cbDBvxHIZBv/tMQQO+aKjbT9E8JFwX41fjDHSbLC5t2jgYpE5CDAnIv+y54I9TUWXEr9HnwTh7Xji9/CZMcB7gfe6+5iqHHgQCfM3+ReLPk2I6m0LG+IdlR9nzoPY6acg5KLRcm 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: --DpcXuOK9+sW5uRJK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 07, 2022 at 11:53:08PM +0100, Fabio M. De Francesco wrote: > diff --git a/Documentation/mm/highmem.rst b/Documentation/mm/highmem.rst > index 0f731d9196b0..59d1078f53df 100644 > --- a/Documentation/mm/highmem.rst > +++ b/Documentation/mm/highmem.rst > @@ -57,7 +57,8 @@ list shows them in order of preference of use. > It can be invoked from any context (including interrupts) but the mapp= ings > can only be used in the context which acquired them. > =20 > - This function should be preferred, where feasible, over all the others. > + This function should always be used. kmap_atomic() and kmap() have been > + deprecated. "... always be used, whereas ..." > + NOTE: Conversions to kmap_local_page() must take care to follow the ma= pping > + restrictions imposed on kmap_local_page(). Furthermore, the code betwe= en > + calls to kmap_atomic() and kunmap_atomic() may implicitly depend on th= e side > + effects of atomic mappings, i.e. disabling page faults or preemption, = or both. > + In that case, explicit calls to pagefault_disable() or preempt_disable= () or > + both must be made in conjunction with the use of kmap_local_page(). > + > ... > + NOTE: Conversions to kmap_local_page() must take care to follow the ma= pping > + restrictions imposed on kmap_local_page(). In particular, it is necess= ary to > + make sure that the kernel virtual memory pointer is only valid in the = thread > + that obtained it. > + What about using note block to signify conversion notes above? ---- >8 ---- diff --git a/Documentation/mm/highmem.rst b/Documentation/mm/highmem.rst index 59d1078f53df57..ef53eb580d4cda 100644 --- a/Documentation/mm/highmem.rst +++ b/Documentation/mm/highmem.rst @@ -103,12 +103,14 @@ list shows them in order of preference of use. =20 * kmap_atomic(). This function has been deprecated; use kmap_local_page(). =20 - NOTE: Conversions to kmap_local_page() must take care to follow the mapp= ing - restrictions imposed on kmap_local_page(). Furthermore, the code between - calls to kmap_atomic() and kunmap_atomic() may implicitly depend on the = side - effects of atomic mappings, i.e. disabling page faults or preemption, or= both. - In that case, explicit calls to pagefault_disable() or preempt_disable()= or - both must be made in conjunction with the use of kmap_local_page(). + .. note:: + Conversions to kmap_local_page() must take care to follow the mapping + restrictions imposed on kmap_local_page(). Furthermore, the code betw= een + calls to kmap_atomic() and kunmap_atomic() may implicitly depend on t= he + side effects of atomic mappings, i.e. disabling page faults or preemp= tion, + or both. In that case, explicit calls to pagefault_disable() or + preempt_disable() or both must be made in conjunction with the use of + kmap_local_page(). =20 [Legacy documentation] =20 @@ -129,10 +131,11 @@ list shows them in order of preference of use. =20 * kmap(). This function has been deprecated; use kmap_local_page(). =20 - NOTE: Conversions to kmap_local_page() must take care to follow the mapp= ing - restrictions imposed on kmap_local_page(). In particular, it is necessar= y to - make sure that the kernel virtual memory pointer is only valid in the th= read - that obtained it. + .. note:: + Conversions to kmap_local_page() must take care to follow the mapping + restrictions imposed on kmap_local_page(). In particular, it is neces= sary + to make sure that the kernel virtual memory pointer is only valid in = the + thread that obtained it. =20 [Legacy documentation] =20 Thanks. --=20 An old man doll... just what I always wanted! - Clara --DpcXuOK9+sW5uRJK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQSSYQ6Cy7oyFNCHrUH2uYlJVVFOowUCY5FmhwAKCRD2uYlJVVFO oyEbAP9nGOIqvunMYBWjKm0wiAVXP9PBwvmq0npDOR8jefqVdAD/VqnrYrP3xgh1 H+9kkiaHpEnQRTgJV4K0W0aMRra/SAI= =T+NX -----END PGP SIGNATURE----- --DpcXuOK9+sW5uRJK--