Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751332AbdGQPfm (ORCPT ); Mon, 17 Jul 2017 11:35:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:46639 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751291AbdGQPfk (ORCPT ); Mon, 17 Jul 2017 11:35:40 -0400 Date: Mon, 17 Jul 2017 17:35:38 +0200 (CEST) From: Miroslav Benes To: Josh Poimboeuf cc: Joe Lawrence , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu , Jiri Kosina , Petr Mladek Subject: Re: [PATCH v2 1/2] livepatch: introduce shadow variable API In-Reply-To: <20170714004149.6jgg4vxmjsotlkus@treble> Message-ID: References: <1498664247-12296-1-git-send-email-joe.lawrence@redhat.com> <1498664247-12296-2-git-send-email-joe.lawrence@redhat.com> <20170714004149.6jgg4vxmjsotlkus@treble> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1825 Lines: 52 On Thu, 13 Jul 2017, Josh Poimboeuf wrote: > On Wed, Jun 28, 2017 at 11:37:26AM -0400, Joe Lawrence wrote: > > > +Brief API summary > > +----------------- > > + > > +See the full API usage docbook notes in the livepatch/shadow.c > > +implementation. > > + > > +An in-kernel hashtable references all of the shadow variables. These > > +references are stored/retrieved through a key pair. > > "num" is rather vague, how about "key"? > > (And note, this and some of the other comments also apply to the code as > well) > > > +* The klp_shadow variable data structure encapsulates both tracking > > +meta-data and shadow-data: > > + - meta-data > > + - obj - pointer to original data > > Instead of "original data", how about calling it the "parent object"? > That describes it better to me at least. "Original data" sounds like > some of the data might be replaced. I agree that "original data" does not sound right. However, we use "parent object" for vmlinux or a module in our code. But I don't have a better name and "parent object" sounds good. > > + - num - numerical description of new data > > "numerical description of new data" sounds a little confusing, how about > "unique identifier for new data"? > > I'm also not sure about the phrase "new data". Maybe something like > "new data field" would be more descriptive? Or just "new field"? I > view it kind of like adding a field to a struct. Not a big deal either > way. > > > +void *klp_shadow_attach(void *obj, unsigned long num, void *new_data, > > + size_t new_size, gfp_t gfp_flags); > > It could be just me, but the "new_" prefixes threw me off a little bit. > The new is implied anyway. How about just "data" and "size"? > > And the same comment for the klp_shadow struct. I agree with Josh on all of this. Miroslav