From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426114AbcBRKUP (ORCPT ); Thu, 18 Feb 2016 05:20:15 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:36353 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426063AbcBRKTq (ORCPT ); Thu, 18 Feb 2016 05:19:46 -0500 Date: Thu, 18 Feb 2016 11:19:42 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: Tony Luck , linux-kernel@vger.kernel.org, Thomas Gleixner , "H. Peter Anvin" , Borislav Petkov , Linus Torvalds , Andrew Morton Subject: Re: [PATCH v11 3/4] x86, mce: Add __mcsafe_copy() Message-ID: <20160218101942.GA9386@gmail.com> References: <20160218082107.GA17851@gmail.com> <20160218095905.GC25010@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160218095905.GC25010@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra wrote: > On Thu, Feb 18, 2016 at 09:21:07AM +0100, Ingo Molnar wrote: > > > > * Tony Luck wrote: > > > > > Make use of the EXTABLE_FAULT exception table entries. This routine > > > returns a structure to indicate the result of the copy: > > > > So the series looks good to me, but I have some (mostly readability) comments that > > went beyond what I usually fix up manually: > > > > > struct mcsafe_ret { > > > u64 trapnr; > > > u64 remain; > > > }; > > > > > +struct mcsafe_ret { > > > + u64 trapnr; > > > + u64 remain; > > > +}; > > > > Yeah, so please change this to something like: > > > > struct mcsafe_ret { > > u64 trap_nr; > > u64 bytes_left; > > }; > > > > this makes it crystal clear what the fields are about and what their unit is. > > Readability is king and modern consoles are wide enough, no need to abbreviate > > excessively. > > I prefer to use my modern console width to display multiple columns of > text, instead of wasting it to display mostly whitespace. Therefore I > still very much prefer ~80 char wide code. This naming won't hurt the col80 limit. > > Also, I'd suggest we postfix the new mcsafe functions with '_mcsafe', not > > prefix them. Special properties of memcpy routines are usually postfixes - > > such as _nocache(), _toio(), etc. > > I think the whole notion of mcsafe here is 'wrong'. This copy variant simply > reports the kind of trap that happened (#PF or #MC) and could arguably be > extended to include more types if the hardware were to generate more. What would a better name be? memcpy_ret() or so? Thanks, Ingo