public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC -tip 0/4] x86: reduce fixup of uaccess
Date: Wed, 07 Jan 2009 01:33:04 -0800	[thread overview]
Message-ID: <496476D0.5040607@zytor.com> (raw)
In-Reply-To: <4962CAAE.6090300@ct.jp.nec.com>

Hiroshi Shimamoto wrote:
> This is my second try to reduce fixup code size for exceptions of uaccess.
> 
> This patch series reduces fixup code for exceptions of uaccess in signal.
> 
> I gave up to make direct jump to end of function when an exception occurs.
> However, I thought fixup code could be reduced. The concept is that to add
> uaccess_err in thread_info and set it to -EFAULT on exception, finally check
> this value on the last of function.
> 
> Is this good to reduce code size?
> 

Hello Hiroshi,

The patches look technically really nice.  I have a couple of stylistic
comments, though, which I'd like yours and others' comments on.

This introduces a new blocking construct, and it's not immediately
obvious in the source code.  I think introducing a technically redundant
set of braces and dropping the parens from the try construct and the
redundant pointer might look better:

	get_user_try {
		/* do stuff */
	} get_user_catch(err);

This makes it, in my opinion, much clearer that it is a new bracing
construct, and it also eliminates the need to form a pointer to "err"
(even though the compiler doesn't actually do so, it looks like it does
to the programmer.)

Also, I don't think we need double underscores for the wrapping
construct, since the get_user/__get_user (check/nocheck) etc.
distinction doesn't directly apply there.

What do you think?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


  parent reply	other threads:[~2009-01-07  9:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06  3:06 [RFC -tip 0/4] x86: reduce fixup of uaccess Hiroshi Shimamoto
2009-01-06  3:08 ` [RFC -tip 1/4] x86: uaccess: rename __put_user_u64() to __put_user_asm_u64() Hiroshi Shimamoto
2009-01-06  3:08 ` [RFC -tip 2/4] x86: uaccess: introduce new __{get|put}_user exception handling framework Hiroshi Shimamoto
2009-01-06  3:09 ` [RFC -tip 3/4] x86: signal: use __{get|put}_user_ex " Hiroshi Shimamoto
2009-01-06  3:10 ` [RFC -tip 4/4] x86: ia32_signal: " Hiroshi Shimamoto
2009-01-06 10:09 ` [RFC -tip 0/4] x86: reduce fixup of uaccess Ingo Molnar
2009-01-07  9:33 ` H. Peter Anvin [this message]
2009-01-08  1:43   ` Hiroshi Shimamoto
2009-01-23 23:48   ` [RFC v2 -tip 0/3] " Hiroshi Shimamoto
2009-01-23 23:49     ` [RFC v2 -tip 1/3] x86: uaccess: introduce try and catch framework Hiroshi Shimamoto
2009-01-23 23:50     ` [RFC v2 -tip 2/3] x86: signal: use {get|put}_user_try and catch Hiroshi Shimamoto
2009-01-23 23:50     ` [RFC v2 -tip 3/3] x86: ia32_signal: " Hiroshi Shimamoto
2009-01-24  7:36       ` Cyrill Gorcunov
2009-01-26 18:31         ` Hiroshi Shimamoto
2009-01-26 18:56           ` Cyrill Gorcunov
2009-01-24  0:51     ` [RFC v2 -tip 0/3] x86: reduce fixup of uaccess H. Peter Anvin
2009-01-24  4:39     ` H. Peter Anvin

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=496476D0.5040607@zytor.com \
    --to=hpa@zytor.com \
    --cc=h-shimamoto@ct.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox