[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090804182457.8135110f.akpm@linux-foundation.org>
Date: Tue, 4 Aug 2009 18:24:57 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: scgtrp@...il.com, bugzilla-daemon@...zilla.kernel.org,
bugme-daemon@...zilla.kernel.org, xiyou.wangcong@...il.com,
linux-kernel@...r.kernel.org
Subject: Re: [BUGFIX][PATCH 2/3] kcore: fix vread/vwrite to be aware of
holes.
On Wed, 5 Aug 2009 10:08:43 +0900 KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com> wrote:
> > > + /*
> > > + * To do safe access to this _mapped_ area, we need
> > > + * lock. But adding lock here means that we need to add
> > > + * overhead of vmalloc()/vfree() calles for this _debug_
> > > + * interface, rarely used. Instead of that, we'll use
> > > + * kmap() and get small overhead in this access function.
> > > + */
> > > + if (p) {
> > > + /* we can expect USR1 is not used */
> >
> > It would be nice if the comment were to explain _why_ KM_USER1 is known
> > to be free here.
> >
> ok, will do. Hmm, but KM_USR0 is better ?
> I'm not sure difference between KM_USR0/KM_USR1...
KM_USER0 is conventionally the first one to use. We only use KM_USER1
if it is known that KM_USER0 is already used.
>
>
> >
> > > + void *map = kmap_atomic(p, KM_USER1);
> > > + memcpy(buf, map + offset, length);
> > > + kunmap_atomic(map, KM_USER1);
> >
> > Can use clear_highpage().
> >
> ah, "buf" is expected to be kmalloc'ed buffer. I'll explain it in Usage
> or adds comment.
>
argh, memcpy != memset. I knew that ;)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists