[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20091122115103.f57f0d0c.akpm@linux-foundation.org>
Date: Sun, 22 Nov 2009 11:51:03 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Ilya Loginov <isloginov@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>, David Woodhouse <dwmw2@...radead.org>,
linux-kernel@...r.kernel.org, Peter Horton <phorton@...box.co.uk>,
"Ed L. Cashin" <ecashin@...aid.com>,
Jens Axboe <jens.axboe@...cle.com>
Subject: Re: [PATCH] mtd: fix mtd_blkdevs problem with caches on some
architectures (2.6.31)
On Sun, 22 Nov 2009 22:18:36 +0300 Ilya Loginov <isloginov@...il.com> wrote:
> On Sun, 22 Nov 2009 10:48:16 -0800
> Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> > I don't think the non-stub versions of these should be inlined. They
> > will generate quite a lot of code and they're pretty heavyweight.
> > Better to implement them in block/ somewhere, and EXPORT_SYMBOL().
>
> I tried this way from the beginning, and to avoid redefinitions I enclose
> everything in #if #endif in *.c files. I think it is not very good.
> So there are two possibilities.
>
> 1. To keep it like it is now and in this way there will be quite a lot of code.
> But in previous letters I gave statistics on the flush_dcache_page call in a
> kernel. And our case is particular. There will not be generated a lot of code.
> Or just take away inline.
>
> 2. Or it is better to carry over normal realization to *.c file and enclose
> everything by one more #if #endif.
>
> What do you consier to be better?
3. :)
In .h:
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
extern void rq_flush_dcache_pages(struct request *rq);
#else
static inline void bio_flush_dcache_pages(struct bio *bi)
{
}
#endif
In .c:
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
void rq_flush_dcache_pages(struct request *rq)
{
struct req_iterator iter;
struct bio_vec* bvec;
rq_for_each_segment(bvec, rq, iter)
flush_dcache_page(bvec->bv_page);
}
EXPORT_SYMBOL(rq_flush_dcache_pages);
#endif
--
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