mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Barry Song <21cnbao@gmail.com>
Cc: viro@zeniv.linux.org.uk, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, Barry Song <v-songbaohua@oppo.com>
Subject: Re: [PATCH] iov_iter: call kmap on each page even for lowmem if CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP is enabled
Date: Sat, 2 Mar 2024 12:32:07 +0800	[thread overview]
Message-ID: <ZeKrx8g3DSHaVWhv@gondor.apana.org.au> (raw)
In-Reply-To: <20240301230908.7507-1-21cnbao@gmail.com>

On Sat, Mar 02, 2024 at 12:09:08PM +1300, Barry Song wrote:
> From: Barry Song <v-songbaohua@oppo.com>
> 
> copy_page_from_iter_atomic() has the assumption lowmem will only
> need one kmap to get start page_address() for all pages. This is
> wrong if the debug option CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP is
> enabled. This patch fixes it in the same way with skbuff.h by
> always applying kmap one by one even for lowmem,
> 
>  static inline bool skb_frag_must_loop(struct page *p)
>  {
>  #if defined(CONFIG_HIGHMEM)
>  	if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP) || PageHighMem(p))
>   		return true;
>  #endif
>  	return false;
>  }

Thanks for the patch.  Perhaps this could be moved into highmem.h
as a helper (kmap_is_highmem)?
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2024-03-02  4:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 23:09 Barry Song
2024-03-02  4:32 ` Herbert Xu [this message]
2024-03-02  8:26   ` Barry Song

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=ZeKrx8g3DSHaVWhv@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v-songbaohua@oppo.com \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®