From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx169.postini.com [74.125.245.169]) by kanga.kvack.org (Postfix) with SMTP id 6CCAB6B006C for ; Thu, 6 Sep 2012 20:00:02 -0400 (EDT) Received: by iec9 with SMTP id 9so4949305iec.14 for ; Thu, 06 Sep 2012 17:00:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1346885323-15689-1-git-send-email-elezegarcia@gmail.com> <1346885323-15689-3-git-send-email-elezegarcia@gmail.com> Date: Thu, 6 Sep 2012 21:00:01 -0300 Message-ID: Subject: Re: [PATCH 3/5] mm, util: Do strndup_user allocation directly, instead of through memdup_user From: Ezequiel Garcia Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: JoonSoo Kim Cc: David Rientjes , linux-mm@kvack.org, Pekka Enberg , Christoph Lameter Hi Joonsoo, On Thu, Sep 6, 2012 at 4:27 PM, JoonSoo Kim wrote: > 2012/9/6 Ezequiel Garcia : >> Hi David, >> >> On Wed, Sep 5, 2012 at 9:59 PM, David Rientjes wrote: >>> On Wed, 5 Sep 2012, Ezequiel Garcia wrote: >>> >>>> I'm not sure this is the best solution, >>>> but creating another function to reuse between strndup_user >>>> and memdup_user seemed like an overkill. >>>> >>> >>> It's not, so you'd need to do two things to fix this: >>> >>> - provide a reason why strndup_user() is special compared to other >>> common library functions that also allocate memory, and >>> >> >> Sorry, I don't understand what you mean. >> strndup_user is *not* special than any other function, simply if you use >> memdup_user for the allocation you will get traces with strndup_user >> as the caller, >> and that's not desirable. > > I'm not sure that this changed should be needed. Why do you think this? > But, if you want to fix this properly, why don't change __krealloc() ? > It is called by krealloc(), and may return krealloc()'s address. That's already fixed and applied on Pekka's tree, it's this one: mm: Use __do_krealloc to do the krealloc job I think this kind of issues are important, yet overlooked, for kmem tracing to become useful. There's a reason we have kmalloc_track_caller, and it would be nice to have them all trace properly. Regards, Ezequiel. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org