From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: Matthew Wilcox <willy@infradead.org>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
rostedt@goodmis.org, mathieu.desnoyers@efficios.com,
jiangshanlai@gmail.com, mingo@redhat.com, cl@linux.com,
penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, brouer@redhat.com, rao.shoaib@oracle.com
Subject: Re: [PATCH 0/2] rcu: Transform kfree_rcu() into kvfree_rcu()
Date: Wed, 7 Feb 2018 00:20:29 -0800 [thread overview]
Message-ID: <20180207082029.GJ3617@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180207075409.GA5726@localhost>
On Tue, Feb 06, 2018 at 11:54:09PM -0800, Josh Triplett wrote:
> On Tue, Feb 06, 2018 at 09:02:00PM -0800, Paul E. McKenney wrote:
> > On Tue, Feb 06, 2018 at 08:23:34PM -0800, Matthew Wilcox wrote:
> > > On Tue, Feb 06, 2018 at 06:17:03PM -0800, Paul E. McKenney wrote:
> > > > So it is OK to kvmalloc() something and pass it to either kfree() or
> > > > kvfree(), and it had better be OK to kvmalloc() something and pass it
> > > > to kvfree().
> > > >
> > > > Is it OK to kmalloc() something and pass it to kvfree()?
> > >
> > > Yes, it absolutely is.
> > >
> > > void kvfree(const void *addr)
> > > {
> > > if (is_vmalloc_addr(addr))
> > > vfree(addr);
> > > else
> > > kfree(addr);
> > > }
> > >
> > > > If so, is it really useful to have two different names here, that is,
> > > > both kfree_rcu() and kvfree_rcu()?
> > >
> > > I think it's handy to have all three of kvfree_rcu(), kfree_rcu() and
> > > vfree_rcu() available in the API for the symmetry of calling kmalloc()
> > > / kfree_rcu().
> > >
> > > Personally, I would like us to rename kvfree() to just free(), and have
> > > malloc(x) be an alias to kvmalloc(x, GFP_KERNEL), but I haven't won that
> > > fight yet.
> >
> > But why not just have the existing kfree_rcu() API cover both kmalloc()
> > and kvmalloc()? Perhaps I am not in the right forums, but I am not hearing
> > anyone arguing that the RCU API has too few members. ;-)
>
> I don't have any problem with having just `kvfree_rcu`, but having just
> `kfree_rcu` seems confusingly asymmetric.
I don't understand why kmalloc()/kvfree_rcu() would seem any less
asymmetric than kvmalloc()/kfree_rcu().
> (Also, count me in favor of having just one "free" function, too.)
We agree on that much, anyway. ;-)
Thanx, Paul
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: Matthew Wilcox <willy@infradead.org>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
rostedt@goodmis.org, mathieu.desnoyers@efficios.com,
jiangshanlai@gmail.com, mingo@redhat.com, cl@linux.com,
penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, brouer@redhat.com, rao.shoaib@oracle.com
Subject: Re: [PATCH 0/2] rcu: Transform kfree_rcu() into kvfree_rcu()
Date: Wed, 7 Feb 2018 00:20:29 -0800 [thread overview]
Message-ID: <20180207082029.GJ3617@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180207075409.GA5726@localhost>
On Tue, Feb 06, 2018 at 11:54:09PM -0800, Josh Triplett wrote:
> On Tue, Feb 06, 2018 at 09:02:00PM -0800, Paul E. McKenney wrote:
> > On Tue, Feb 06, 2018 at 08:23:34PM -0800, Matthew Wilcox wrote:
> > > On Tue, Feb 06, 2018 at 06:17:03PM -0800, Paul E. McKenney wrote:
> > > > So it is OK to kvmalloc() something and pass it to either kfree() or
> > > > kvfree(), and it had better be OK to kvmalloc() something and pass it
> > > > to kvfree().
> > > >
> > > > Is it OK to kmalloc() something and pass it to kvfree()?
> > >
> > > Yes, it absolutely is.
> > >
> > > void kvfree(const void *addr)
> > > {
> > > if (is_vmalloc_addr(addr))
> > > vfree(addr);
> > > else
> > > kfree(addr);
> > > }
> > >
> > > > If so, is it really useful to have two different names here, that is,
> > > > both kfree_rcu() and kvfree_rcu()?
> > >
> > > I think it's handy to have all three of kvfree_rcu(), kfree_rcu() and
> > > vfree_rcu() available in the API for the symmetry of calling kmalloc()
> > > / kfree_rcu().
> > >
> > > Personally, I would like us to rename kvfree() to just free(), and have
> > > malloc(x) be an alias to kvmalloc(x, GFP_KERNEL), but I haven't won that
> > > fight yet.
> >
> > But why not just have the existing kfree_rcu() API cover both kmalloc()
> > and kvmalloc()? Perhaps I am not in the right forums, but I am not hearing
> > anyone arguing that the RCU API has too few members. ;-)
>
> I don't have any problem with having just `kvfree_rcu`, but having just
> `kfree_rcu` seems confusingly asymmetric.
I don't understand why kmalloc()/kvfree_rcu() would seem any less
asymmetric than kvmalloc()/kfree_rcu().
> (Also, count me in favor of having just one "free" function, too.)
We agree on that much, anyway. ;-)
Thanx, Paul
next prev parent reply other threads:[~2018-02-07 8:20 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 10:19 [PATCH 0/2] rcu: Transform kfree_rcu() into kvfree_rcu() Kirill Tkhai
2018-02-06 10:19 ` Kirill Tkhai
2018-02-06 10:19 ` [PATCH 1/2] " Kirill Tkhai
2018-02-06 10:19 ` Kirill Tkhai
2018-02-06 14:34 ` Steven Rostedt
2018-02-06 14:34 ` Steven Rostedt
2018-02-06 15:06 ` Kirill Tkhai
2018-02-06 15:06 ` Kirill Tkhai
2018-02-06 15:49 ` Steven Rostedt
2018-02-06 15:49 ` Steven Rostedt
2018-02-06 10:19 ` [PATCH 2/2] mm: Use kvfree_rcu() in update_memcg_params() Kirill Tkhai
2018-02-06 10:19 ` Kirill Tkhai
2018-02-07 2:17 ` [PATCH 0/2] rcu: Transform kfree_rcu() into kvfree_rcu() Paul E. McKenney
2018-02-07 2:17 ` Paul E. McKenney
2018-02-07 4:23 ` Matthew Wilcox
2018-02-07 4:23 ` Matthew Wilcox
2018-02-07 5:02 ` Paul E. McKenney
2018-02-07 5:02 ` Paul E. McKenney
2018-02-07 7:54 ` Josh Triplett
2018-02-07 7:54 ` Josh Triplett
2018-02-07 8:20 ` Paul E. McKenney [this message]
2018-02-07 8:20 ` Paul E. McKenney
2018-02-07 7:57 ` Kirill Tkhai
2018-02-07 7:57 ` Kirill Tkhai
2018-02-07 8:31 ` Paul E. McKenney
2018-02-07 8:31 ` Paul E. McKenney
2018-02-07 13:57 ` Steven Rostedt
2018-02-07 13:57 ` Steven Rostedt
2018-02-07 16:18 ` Matthew Wilcox
2018-02-07 16:18 ` Matthew Wilcox
2018-02-07 16:34 ` Steven Rostedt
2018-02-07 16:34 ` Steven Rostedt
2018-02-07 16:45 ` Jesper Dangaard Brouer
2018-02-07 16:45 ` Jesper Dangaard Brouer
2018-02-07 18:10 ` Matthew Wilcox
2018-02-07 18:10 ` Matthew Wilcox
2018-02-07 18:26 ` Steven Rostedt
2018-02-07 18:26 ` Steven Rostedt
2018-02-08 4:10 ` Paul E. McKenney
2018-02-08 4:10 ` Paul E. McKenney
2018-02-22 23:55 ` Paul E. McKenney
2018-02-22 23:55 ` Paul E. McKenney
2018-02-08 4:09 ` Paul E. McKenney
2018-02-08 4:09 ` Paul E. McKenney
2018-02-07 16:47 ` Christopher Lameter
2018-02-07 16:47 ` Christopher Lameter
2018-02-07 17:09 ` Steven Rostedt
2018-02-07 17:09 ` Steven Rostedt
2018-02-07 17:19 ` Matthew Wilcox
2018-02-07 17:19 ` Matthew Wilcox
2018-02-07 17:29 ` Steven Rostedt
2018-02-07 17:29 ` Steven Rostedt
2018-02-07 17:54 ` Christopher Lameter
2018-02-07 17:54 ` Christopher Lameter
2018-02-07 14:55 ` Christopher Lameter
2018-02-07 14:55 ` Christopher Lameter
2018-02-08 4:09 ` Paul E. McKenney
2018-02-08 4:09 ` Paul E. McKenney
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=20180207082029.GJ3617@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=brouer@redhat.com \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@redhat.com \
--cc=penberg@kernel.org \
--cc=rao.shoaib@oracle.com \
--cc=rientjes@google.com \
--cc=rostedt@goodmis.org \
--cc=willy@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.