linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [RFC] atomic highmem kmap page pinning
Date: Sat, 07 Mar 2009 17:28:06 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0903071721040.30483@xanadu.home> (raw)
In-Reply-To: <28c262360903051514n53e54df8x935aa398e16795ce@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1904 bytes --]

On Fri, 6 Mar 2009, Minchan Kim wrote:

> On Fri, Mar 6, 2009 at 7:59 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Fri, Mar 06, 2009 at 07:23:44AM +0900, Minchan Kim wrote:
> >> > +#ifdef ARCH_NEEDS_KMAP_HIGH_GET
> >> > +/**
> >> > + * kmap_high_get - pin a highmem page into memory
> >> > + * @page: &struct page to pin
> >> > + *
> >> > + * Returns the page's current virtual memory address, or NULL if no mapping
> >> > + * exists. A When and only when a non null address is returned then a
> >> > + * matching call to kunmap_high() is necessary.
> >> > + *
> >> > + * This can be called from any context.
> >> > + */
> >> > +void *kmap_high_get(struct page *page)
> >> > +{
> >> > + A  A  A  unsigned long vaddr, flags;
> >> > +
> >> > + A  A  A  spin_lock_kmap_any(flags);
> >> > + A  A  A  vaddr = (unsigned long)page_address(page);
> >> > + A  A  A  if (vaddr) {
> >> > + A  A  A  A  A  A  A  BUG_ON(pkmap_count[PKMAP_NR(vaddr)] < 1);
> >> > + A  A  A  A  A  A  A  pkmap_count[PKMAP_NR(vaddr)]++;
> >> > + A  A  A  }
> >> > + A  A  A  spin_unlock_kmap_any(flags);
> >> > + A  A  A  return (void*) vaddr;
> >> > +}
> >> > +#endif
> >>
> >> Let's add empty function for architecture of no ARCH_NEEDS_KMAP_HIGH_GET,
> >
> > The reasoning being?
> 
> I thought it can be used in common arm function.
> so, for VIVT, it can be work but for VIPT, it can be nulled as
> preventing compile error.

The issue is not about VIVT vs VIPT, but rather about the fact that IO 
transactions don't snoop the cache.  So this is needed even for current 
VIPT implementations.

> But, I don't know where we use kmap_high_get since I didn't see any
> patch which use it.
> If it is only used architecture specific place,  pz, forgot my comment.

Yes, that's the case.  And it is much preferable to have a compilation 
error than providing an empty stub to silently mask out misuses.


Nicolas

      reply	other threads:[~2009-03-07 22:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04  5:58 Nicolas Pitre
2009-03-04  7:39 ` Andrew Morton
2009-03-04  8:14 ` Minchan Kim
2009-03-04 17:26   ` Nicolas Pitre
2009-03-04 23:07     ` Minchan Kim
2009-03-04 23:46       ` Russell King - ARM Linux
2009-03-05  0:25         ` Minchan Kim
2009-03-05  0:30           ` Minchan Kim
2009-03-05  2:37       ` Nicolas Pitre
2009-03-05  4:20         ` Minchan Kim
2009-03-05  4:57           ` Nicolas Pitre
2009-03-05 22:23             ` Minchan Kim
2009-03-05 22:59               ` Russell King - ARM Linux
2009-03-05 23:14                 ` Minchan Kim
2009-03-07 22:28                   ` Nicolas Pitre [this message]

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=alpine.LFD.2.00.0903071721040.30483@xanadu.home \
    --to=nico@cam.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@arm.linux.org.uk \
    --cc=minchan.kim@gmail.com \
    /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