Linux Documentation
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	SeongJae Park <sj@kernel.org>,
	Jiajian Ye <yejiajian2018@email.szu.edu.cn>,
	Thomas Gleixner <tglx@linutronix.de>,
	Matthew Wilcox <willy@infradead.org>,
	Peter Zijlstra <peterz@infradead.org>,
	outreachy@lists.linux.dev, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] Documentation/vm: Include kernel-doc to highmem.rst
Date: Mon, 18 Apr 2022 14:32:00 -0700	[thread overview]
Message-ID: <Yl3Y0F/WT5xKoJCt@iweiny-desk3> (raw)
In-Reply-To: <20220415231917.25962-3-fmdefrancesco@gmail.com>

On Sat, Apr 16, 2022 at 01:19:17AM +0200, Fabio M. De Francesco wrote:
> Include kernel-doc comments to highmem.rst from
> include/kernel/highmem.h.
> 
> From now on, the "Using kmap_atomic" section is redundant and obsolete,
> therefore remove it.
> 
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ira Weiny <ira.weiny@intel.com>
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  Documentation/vm/highmem.rst | 41 ++++++------------------------------
>  1 file changed, 6 insertions(+), 35 deletions(-)
> 
> diff --git a/Documentation/vm/highmem.rst b/Documentation/vm/highmem.rst
> index 12dcfbee094d..5dcee6233cd5 100644
> --- a/Documentation/vm/highmem.rst
> +++ b/Documentation/vm/highmem.rst
> @@ -117,41 +117,6 @@ The kernel contains several ways of creating temporary mappings:
>    synchronization to unmap.
>  
>  
> -Using kmap_atomic
> -=================
> -
> -When and where to use kmap_atomic() is straightforward.  It is used when code
> -wants to access the contents of a page that might be allocated from high memory
> -(see __GFP_HIGHMEM), for example a page in the pagecache.  The API has two
> -functions, and they can be used in a manner similar to the following::
> -
> -	/* Find the page of interest. */
> -	struct page *page = find_get_page(mapping, offset);
> -
> -	/* Gain access to the contents of that page. */
> -	void *vaddr = kmap_atomic(page);
> -
> -	/* Do something to the contents of that page. */
> -	memset(vaddr, 0, PAGE_SIZE);
> -
> -	/* Unmap that page. */
> -	kunmap_atomic(vaddr);
> -
> -Note that the kunmap_atomic() call takes the result of the kmap_atomic() call
> -not the argument.
> -
> -If you need to map two pages because you want to copy from one page to
> -another you need to keep the kmap_atomic calls strictly nested, like::
> -
> -	vaddr1 = kmap_atomic(page1);
> -	vaddr2 = kmap_atomic(page2);
> -
> -	memcpy(vaddr1, vaddr2, PAGE_SIZE);
> -
> -	kunmap_atomic(vaddr2);
> -	kunmap_atomic(vaddr1);
> -
> -
>  Cost of Temporary Mappings
>  ==========================
>  
> @@ -190,3 +155,9 @@ The general recommendation is that you don't use more than 8GiB on a 32-bit
>  machine - although more might work for you and your workload, you're pretty
>  much on your own - don't expect kernel developers to really care much if things
>  come apart.
> +
> +
> +Functions
> +=========
> +
> +.. kernel-doc:: include/linux/highmem.h
> -- 
> 2.34.1
> 

  reply	other threads:[~2022-04-18 21:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 23:19 [PATCH v3 0/2] Documentation/vm: Rework and extend highmem.rst Fabio M. De Francesco
2022-04-15 23:19 ` [PATCH v3 1/2] Documentation/vm: Extend "Temporary Virtual Mappings" section Fabio M. De Francesco
2022-04-18 21:30   ` Ira Weiny
2022-04-19 14:52     ` Fabio M. De Francesco
2022-04-15 23:19 ` [PATCH v3 2/2] Documentation/vm: Include kernel-doc to highmem.rst Fabio M. De Francesco
2022-04-18 21:32   ` Ira Weiny [this message]
2022-04-21 17:51 ` [PATCH v3 0/2] Documentation/vm: Rework and extend highmem.rst Fabio M. De Francesco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yl3Y0F/WT5xKoJCt@iweiny-desk3 \
    --to=ira.weiny@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=fmdefrancesco@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=outreachy@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=sj@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.org \
    --cc=yejiajian2018@email.szu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox