[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080114172114.GR6258@kernel.dk>
Date: Mon, 14 Jan 2008 18:21:15 +0100
From: Jens Axboe <jens.axboe@...cle.com>
To: Matthew Wilcox <matthew@....cx>
Cc: Nick Piggin <npiggin@...e.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-fsdevel@...r.kernel.org,
Christian Borntraeger <borntraeger@...ibm.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Andrew Morton <akpm@...ux-foundation.org>, rob@...dley.net
Subject: Re: [patch] rewrite rd
On Mon, Jan 14 2008, Matthew Wilcox wrote:
> On Tue, Dec 04, 2007 at 05:26:28AM +0100, Nick Piggin wrote:
> > +static void copy_to_brd(struct brd_device *brd, const void *src,
> > + sector_t sector, size_t n)
> > +{
> > + struct page *page;
> > + void *dst;
> > + unsigned int offset = (sector & (PAGE_SECTORS-1)) << SECTOR_SHIFT;
> > + size_t copy;
> > +
> > + copy = min((unsigned long)n, PAGE_SIZE - offset);
> > + page = brd_lookup_page(brd, sector);
> > + BUG_ON(!page);
> > +
> > + dst = kmap_atomic(page, KM_USER1);
> > + memcpy(dst + offset, src, copy);
> > + kunmap_atomic(dst, KM_USER1);
>
> You're using kmap_atomic, but I see no reason you can't be preempted.
> Don't you need to at least disable preemption while you have stuff
> atomically kmapped?
kmap_atomic() disables preemption through pagefault_disable().
--
Jens Axboe
--
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