All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ilya Loginov <isloginov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-kernel@vger.kernel.org, Peter Horton <phorton@bitbox.co.uk>,
	"Ed L. Cashin" <ecashin@coraid.com>,
	Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] mtd: fix mtd_blkdevs problem with caches on some architectures (2.6.31)
Date: Sun, 22 Nov 2009 11:51:03 -0800	[thread overview]
Message-ID: <20091122115103.f57f0d0c.akpm@linux-foundation.org> (raw)
In-Reply-To: <20091122221836.d2d7535d.isloginov@gmail.com>

On Sun, 22 Nov 2009 22:18:36 +0300 Ilya Loginov <isloginov@gmail.com> wrote:

> On Sun, 22 Nov 2009 10:48:16 -0800
> Andrew Morton <akpm@linux-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

  reply	other threads:[~2009-11-22 19:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 14:08 [PATCH] mtd: fix mtd_blkdevs problem with caches on some architectures (2.6.31) Ilya Loginov
2009-11-21  0:37 ` Andrew Morton
2009-11-21 14:04   ` Ilya Loginov
2009-11-21 17:54     ` Andrew Morton
2009-11-21 23:11       ` Ilya Loginov
2009-11-21 23:26         ` Andrew Morton
2009-11-21 23:36           ` Ilya Loginov
2009-11-22  9:46           ` Ilya Loginov
2009-11-22  9:53             ` David Woodhouse
2009-11-22 18:49               ` Ilya Loginov
2009-11-22 13:29             ` Ingo Molnar
2009-11-22 13:55               ` Ilya Loginov
2009-11-22 18:48                 ` Andrew Morton
2009-11-22 19:18                   ` Ilya Loginov
2009-11-22 19:51                     ` Andrew Morton [this message]
2009-11-22 20:55                       ` Ilya Loginov
2009-11-24 20:48                         ` Andrew Morton
2009-11-25  1:01                           ` Ilya Loginov

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=20091122115103.f57f0d0c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=ecashin@coraid.com \
    --cc=isloginov@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=phorton@bitbox.co.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.