All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jens Axboe <jens.axboe@oracle.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: Tejun Heo <htejun@gmail.com>,
	Arjan van de Ven <arjan@infradead.org>,
	Hugh Dickins <hugh@veritas.com>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] Fix kunmap() argument in sg_miter_stop
Date: Mon, 17 Nov 2008 10:41:47 +0100	[thread overview]
Message-ID: <20081117094147.GJ28786@elte.hu> (raw)
In-Reply-To: <20081117093425.GG26778@kernel.dk>


* Jens Axboe <jens.axboe@oracle.com> wrote:

> On Mon, Nov 17 2008, Jens Axboe wrote:
> > On Mon, Nov 17 2008, Ingo Molnar wrote:
> > > 
> > > * Jens Axboe <jens.axboe@oracle.com> wrote:
> > > 
> > > > On Mon, Nov 17 2008, Ingo Molnar wrote:
> > > > > 
> > > > > * Jens Axboe <jens.axboe@oracle.com> wrote:
> > > > > 
> > > > > > +#define kunmap(p)			\
> > > > > > +	do {				\
> > > > > > +		struct page *__p;	\
> > > > > > +		(void) (&__p == &(p));	\
> > > > > > +		__kunmap(p);		\
> > > > > > +	} while (0)
> > > > > > +
> > > > > > +#define kunmap_atomic(a, t)		\
> > > > > > +	do {				\
> > > > > > +		void *__p;		\
> > > > > > +		(void) (&__p == &(a));	\
> > > > > > +		__kunmap_atomic(a, t);	\
> > > > > > +	} while (0)
> > > > > 
> > > > > Agreed - but please use the typecheck() primitive. (linux/typecheck.h)
> > > > 
> > > > Neat, didn't know about that, thanks.
> > > 
> > > and ack on your patch obviously. Feel free to push it via the block 
> > > tree straight away, it doesnt collide with anything pending in the x86 
> > > tree.
> > > 
> > > Acked-by: Ingo Molnar <mingo@elte.hu>
> > 
> > The kunmap() bit is easy to do as I mentioned, but the kunmap_atomic()
> > gets a bit more ugly. Lots of users can just be switched to void *
> > types, but some get ugly like:
> > 
> > static struct page **shmem_dir_map(struct page *page)
> >         return (struct page **)kmap_atomic(page, KM_USER0);
> >  }
> >  
> > -static inline void shmem_dir_unmap(struct page **dir)
> > +static inline void shmem_dir_unmap(void *dir)
> >  {
> >         kunmap_atomic(dir, KM_USER0);
> >  }
> > 
> > and others again like fs/exec.c:remove_arg_zero() would really like to
> > use a char * type since it dereferences it.
> > 
> > I think the kunmap_atomic() change it the most needed part of the patch,
> > but I don't think it can come for free (eg, we have to add variable to
> > the above function).
> 
> OK, (void *) cast works fine when I fixed it. Here's a normal build diff
> to show approximately how bad it is. I expected it to be worse, so it
> looks quite doable I think.

hm:

   32 files changed, 89 insertions(+), 62 deletions(-)

regarding churn it looks a bit like on the high side. OTOH it's 
trivial, most of the churn is spread-out in various architectures, and 
it can catch real bugs so i'm still acking it.

Could you please send the patch with a full changelog? I've Cc:-ed 
Linus and Andrew - please let us know if you think that this too much 
churn for -rc6.

	Ingo

  reply	other threads:[~2008-11-17  9:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-15 19:27 [PATCH] Fix kunmap() argument in sg_miter_stop Arjan van de Ven
2008-11-15 20:15 ` Hugh Dickins
2008-11-15 20:27   ` Arjan van de Ven
2008-11-15 20:39   ` Arjan van de Ven
2008-11-16  5:16     ` Tejun Heo
2008-11-17  8:11       ` Jens Axboe
2008-11-17  8:22         ` Ingo Molnar
2008-11-17  8:30           ` Jens Axboe
2008-11-17  8:50             ` Ingo Molnar
2008-11-17  8:58               ` Jens Axboe
2008-11-17  9:34                 ` Jens Axboe
2008-11-17  9:41                   ` Ingo Molnar [this message]
2008-11-17  9:45                     ` Jens Axboe
2008-11-17 11:13                       ` Jens Axboe
2008-11-17 17:08                         ` Jeremy Fitzhardinge
2008-11-17 17:10                           ` Ingo Molnar
2008-11-17 17:15                             ` Jeremy Fitzhardinge
2008-11-17 17:25                               ` Linus Torvalds
2008-11-17 17:35                                 ` Jeremy Fitzhardinge
2008-11-17 18:14                                   ` [PATCH] xen: fix scrub_page() Ingo Molnar
2008-11-17 18:07                                 ` [PATCH] Fix kunmap() argument in sg_miter_stop Jens Axboe
2008-11-17 18:16                                   ` Linus Torvalds
2008-11-17 18:26                                     ` Jens Axboe
2008-11-18  8:27                                       ` Ingo Molnar

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=20081117094147.GJ28786@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=htejun@gmail.com \
    --cc=hugh@veritas.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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.