[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m37ic4jr2w.fsf@gravicappa.englab.brq.redhat.com>
Date: Wed, 02 Jul 2008 16:31:03 +0200
From: Vitaly Mayatskikh <v.mayatskih@...il.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: Vitaly Mayatskikh <v.mayatskih@...il.com>,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/2] Introduce copy_user_handle_tail routine
Andi Kleen <andi@...stfloor.org> writes:
> get/put user are macros and it's normally not a good idea to use ++ in macro
> arguments because they might expand multiple times.
>
> sizeof(char) is always 1
>
> Also hopefully there's no sign extension anywhere with the signed char
I have tested it a lot. I don't know of any fail scenario at the moment.
> Overall you could write it much simpler with a rep ; movs I think,
> like traditional linux did.
rep movs can fail.
> Similar problem with ++
>
> If zerorest is ever 0 then retesting it on every iteration seems
> somewhat dumb.
If zerorest is 0, this cycle will never be executed.
>
> I think a simple memset would be actually ok, i don't think we ever zero
> anything that faults. That would be obviously racy anyways. If the zero
> are supposed to override something then a racing user thread could always
> catch it.
Linus wanted this routine to be extremely dumb. This is the reason why tail
handling was moved from assembly to C. Yeah, my original patches were in
assembly and on the top of your realization.
--
wbr, Vitaly
--
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