linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: "Drokin, Oleg" <oleg.drokin@intel.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	"<devel@driverdev.osuosl.org>" <devel@driverdev.osuosl.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"<kernel-janitors@vger.kernel.org>"
	<kernel-janitors@vger.kernel.org>,
	"<linux-kernel@vger.kernel.org>" <linux-kernel@vger.kernel.org>,
	"<HPDD-discuss@ml01.01.org>" <HPDD-discuss@ml01.01.org>
Subject: Re: [HPDD-discuss] [PATCH] staging: lustre: llite: Use kzalloc and rewrite null tests
Date: Fri, 19 Sep 2014 15:50:01 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1409191546440.2525@hadrien> (raw)
In-Reply-To: <4533064F-A093-4DED-8294-CF049CB591A8@intel.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2642 bytes --]



On Fri, 19 Sep 2014, Drokin, Oleg wrote:

> Hello!
>
>    First, thanks for your patches and efforts spent on these cleanups.
>
> On Sep 19, 2014, at 12:45 AM, Julia Lawall wrote:
>
> > With respect to the upper case lower case issue, does the thing need to be
> > a macro?  I think that the lowercase is more or less fine, but only if
> > what is behind it is a function.
>
> I don't have a strong opinion either way as long as we have all the functionality
> we need.
>
> > I say more or less fine, because normally in the kernel the special
> > allocators have special purposes, eg allocating and initializing the xyz
> > structure.  Here what is wanted is a general purpose allocator with lots
> > of special tracing features, so it is not quite the same thing.  And one
> > can wonder why all of these special tracing features are not relevant to
> > the kernel as a whole?
>
> Like I explained in my previous email, many of the tracing features are already
> possible to replace with other existing in-kernel mechanisms like kmemleak.
>
> Except the total tally of allocations/frees so that a memleak could be visibly
> easily seen on module unload time. I think this would be useful for other
> kinds of modules too, not just lustre, so having that as a generic allocator
> feature would be cool too.
>
> > In reading through the description of the needed features, it seems like
> > only the _ptr extension requires being a macro.  Do we need that?  The
>
> We only need that as a less error-prone way of having
> x = obd_kzalloc(sizeof(*x), ….)
> …
> obd_free(…, sizeof(*x))
>
> Real free function does not take size argument, but we need that for
> total allocated/freed accounting. Easy to have disconnect with
> the size argument of obd_free to be wrong.
>
> > rest of the kernel manages to do x = kzalloc(sizeof(*x),...) ok.  It's
> > unpleasant to have an assignment hidden in this way.  And currently it is
> > not used consistently.  There are some OBD_ALLOCs that have the same form.
>
> Yes, those are converted as thy are noticed.
>
> > Sorry for overlooking the frees.  I was focusing on trying one thing at a
> > time...
>
> I kind of think it's a related issue.
> Touching ones needs to touch the other if not in the same patch then in
> a next patch. And that's why I think consideations for what FREEs would need
> is needed from the start, so the FREEs removal patch does not goes and patches a bunch of just patched allocs.

Sure, it's fine.

Where do you want to go from here?  Should I propose function definitions
for obd_alloc and obd_free?  Could we leave the vmalloc issue for a future
set of changes?

julia

  reply	other threads:[~2014-09-19 13:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 20:24 [PATCH] Use kzalloc and rewrite null tests Julia Lawall
2014-09-18 20:24 ` [PATCH] staging: lustre: llite: " Julia Lawall
2014-09-18 23:43   ` Dan Carpenter
2014-09-19  2:57     ` Drokin, Oleg
2014-09-19  3:04       ` [HPDD-discuss] " Drokin, Oleg
2014-09-19  4:45         ` Julia Lawall
2014-09-19 13:36           ` Drokin, Oleg
2014-09-19 13:50             ` Julia Lawall [this message]
2014-09-19  9:11       ` Dan Carpenter
2014-09-19 13:27         ` Drokin, Oleg

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=alpine.DEB.2.10.1409191546440.2525@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=HPDD-discuss@ml01.01.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).