From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D38D6B6F98 for ; Wed, 16 Nov 2011 10:46:55 +1100 (EST) Message-ID: <1321400792.3170.17.camel@pasglop> Subject: Re: [RFC PATCH 0/2] powerpc: CPU cache op cleanup From: Benjamin Herrenschmidt To: "Moffett, Kyle D" Date: Wed, 16 Nov 2011 10:46:32 +1100 In-Reply-To: <022078B9-CD41-4D24-B44A-F85256A69D0A@boeing.com> References: <1320986410.21206.48.camel@pasglop> <1321324332-22964-1-git-send-email-Kyle.D.Moffett@boeing.com> <1321396146.3170.11.camel@pasglop> <022078B9-CD41-4D24-B44A-F85256A69D0A@boeing.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: Anton Blanchard , "B04825@freescale.com" , "linux-kernel@vger.kernel.org" , "paul.gortmaker@windriver.com" , "scottwood@freescale.com" , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2011-11-15 at 16:45 -0600, Moffett, Kyle D wrote: > I guess that's doable, although I have to admit that idea almost gives > me more of a headache than trying to fix up the 32-bit ASM. > > One thing that bothers me in particular is that both 32/64 versions of > __copy_tofrom_user() are dramatically overcomplicated for what they > ought to be doing. > > It would seem that if we get a page fault during an unaligned copy, we > ought to just give up and fall back to a simple byte-by-byte copy loop > from wherever we left off. That would eliminate 90% of the ugly > special cases without actually hurting performance, right? > > For a page-fault during a cacheline-aligned copy, we should be able to > handle the exception and retry from the last cacheline without much > logic, again with good performance. > > With that said, I'm curious about the origin of the PPC32 ASM. In > particular, it looks like it was generated by GCC at some point in the > distant past, and I'm wondering if there's a good way to rewrite that > file in C and trick GCC into generating the relevant exception tables > for it? There is some serious history in there :-) I would check with Anton, he's been doing some performance work on those lately (the 64-bit ones). It's probably worth throwing a proof-of-concept simpler variant for 32-bit at least on the table and have people compare the perfs (typically network perfs). I can test on a range of ppc32 here (6xx, 7xxx, 4xx). Cheers, Ben.