[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140910065129.GN6549@mwanda>
Date: Wed, 10 Sep 2014 09:51:29 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Valdis.Kletnieks@...edu
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Jiri Kosina <jkosina@...e.cz>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
"Theodore Ts'o" <tytso@....edu>
Subject: Re: [PATCH] mm/sl[aou]b: make kfree() aware of error pointers
On Wed, Sep 10, 2014 at 01:15:15AM -0400, Valdis.Kletnieks@...edu wrote:
> On Tue, 09 Sep 2014 16:21:14 -0700, Andrew Morton said:
> > On Tue, 9 Sep 2014 23:25:28 +0200 (CEST) Jiri Kosina <jkosina@...e.cz> wrote:
> > kfree() is quite a hot path to which this will add overhead. And we
> > have (as far as we know) no code which will actually use this at
> > present.
>
> We already do a check for ZERO_SIZE_PTR, and given that dereferencing *that* is
> instant death for the kernel, and we see it very rarely, I'm going to guess
> that IS_ERR(ptr) *has* to be true more often than ZERO_SIZE_PTR, and thus even
> more advantageous to short-circuit.
ZERO_SIZE_PTR is sort of common.
ZERO_SIZE_PTR is an mm abstraction and kfree() and ksize() are basically
the only places where we need to test for it. Also friends of kfree()
like jbd2_journal_free_transaction().
regards,
dan carpenter
--
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