All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backport: add some new kv[mz]alloc function
@ 2017-07-21  6:55 AceLan Kao
  2017-07-21 13:21 ` Luca Coelho
  2017-09-06 22:05 ` Hauke Mehrtens
  0 siblings, 2 replies; 7+ messages in thread
From: AceLan Kao @ 2017-07-21  6:55 UTC (permalink / raw)
  To: hauke, mcgrof, backports

add some new kv[mz]alloc functions which introduced after v4.12
by this commit

commit a7c3e901a46ff54c016d040847eda598a9e3e653
Author: Michal Hocko <mhocko@suse.com>
Date:   Mon May 8 15:57:09 2017 -0700

    mm: introduce kv[mz]alloc helpers

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
---
 backport/backport-include/linux/mm.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
index 3234b37..8125310 100644
--- a/backport/backport-include/linux/mm.h
+++ b/backport/backport-include/linux/mm.h
@@ -123,4 +123,20 @@ static inline bool page_is_pfmemalloc(struct page *page)
 }
 #endif /* < 4.2 */
 
+#if LINUX_VERSION_IS_LESS(4,12,0)
+extern void *kvmalloc_node(size_t size, gfp_t flags, int node);
+static inline void *kvmalloc(size_t size, gfp_t flags)
+{
+	return kvmalloc_node(size, flags, NUMA_NO_NODE);
+}
+static inline void *kvzalloc_node(size_t size, gfp_t flags, int node)
+{
+	return kvmalloc_node(size, flags | __GFP_ZERO, node);
+}
+static inline void *kvzalloc(size_t size, gfp_t flags)
+{
+	return kvmalloc(size, flags | __GFP_ZERO);
+}
+#endif /* < 4.12.0 */
+
 #endif /* __BACKPORT_MM_H */
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] backport: add some new kv[mz]alloc function
  2017-07-21  6:55 [PATCH] backport: add some new kv[mz]alloc function AceLan Kao
@ 2017-07-21 13:21 ` Luca Coelho
  2017-07-22  7:52   ` Arend van Spriel
  2017-09-06 22:05 ` Hauke Mehrtens
  1 sibling, 1 reply; 7+ messages in thread
From: Luca Coelho @ 2017-07-21 13:21 UTC (permalink / raw)
  To: AceLan Kao, hauke, mcgrof, backports

On Fri, 2017-07-21 at 14:55 +0800, AceLan Kao wrote:
> add some new kv[mz]alloc functions which introduced after v4.12
> by this commit
> 
> commit a7c3e901a46ff54c016d040847eda598a9e3e653
> Author: Michal Hocko <mhocko@suse.com>
> Date:   Mon May 8 15:57:09 2017 -0700
> 
>     mm: introduce kv[mz]alloc helpers
> 
> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
> ---

I don't see any backported code using any of these yet... Why do you
need it?

--
Cheers,
Luca.
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] backport: add some new kv[mz]alloc function
  2017-07-21 13:21 ` Luca Coelho
@ 2017-07-22  7:52   ` Arend van Spriel
  2017-07-22 11:29     ` Luca Coelho
  0 siblings, 1 reply; 7+ messages in thread
From: Arend van Spriel @ 2017-07-22  7:52 UTC (permalink / raw)
  To: Luca Coelho, AceLan Kao, hauke, mcgrof, backports

On 21-07-17 15:21, Luca Coelho wrote:
> On Fri, 2017-07-21 at 14:55 +0800, AceLan Kao wrote:
>> add some new kv[mz]alloc functions which introduced after v4.12
>> by this commit
>>
>> commit a7c3e901a46ff54c016d040847eda598a9e3e653
>> Author: Michal Hocko <mhocko@suse.com>
>> Date:   Mon May 8 15:57:09 2017 -0700
>>
>>     mm: introduce kv[mz]alloc helpers
>>
>> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
>> ---
> 
> I don't see any backported code using any of these yet... Why do you
> need it?

AceLan is trying to reinstate BT subsystem/drivers in backports so it
may be needed for that. If that is true I think this patch should go in
that "BT reinstatement" patch series.

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] backport: add some new kv[mz]alloc function
  2017-07-22  7:52   ` Arend van Spriel
@ 2017-07-22 11:29     ` Luca Coelho
  2017-07-24  2:40       ` AceLan Kao
  0 siblings, 1 reply; 7+ messages in thread
From: Luca Coelho @ 2017-07-22 11:29 UTC (permalink / raw)
  To: Arend van Spriel, AceLan Kao, hauke, mcgrof, backports



On July 22, 2017 10:52:13 AM GMT+03:00, Arend van Spriel <arend.vanspriel@broadcom.com> wrote:
>On 21-07-17 15:21, Luca Coelho wrote:
>> On Fri, 2017-07-21 at 14:55 +0800, AceLan Kao wrote:
>>> add some new kv[mz]alloc functions which introduced after v4.12
>>> by this commit
>>>
>>> commit a7c3e901a46ff54c016d040847eda598a9e3e653
>>> Author: Michal Hocko <mhocko@suse.com>
>>> Date:   Mon May 8 15:57:09 2017 -0700
>>>
>>>     mm: introduce kv[mz]alloc helpers
>>>
>>> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
>>> ---
>> 
>> I don't see any backported code using any of these yet... Why do you
>> need it?
>
>AceLan is trying to reinstate BT subsystem/drivers in backports so it
>may be needed for that. If that is true I think this patch should go in
>that "BT reinstatement" patch series.


Yeah, but I even checked BT stuff and didn't find any occurrences...

-- 
Luca.
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] backport: add some new kv[mz]alloc function
  2017-07-22 11:29     ` Luca Coelho
@ 2017-07-24  2:40       ` AceLan Kao
  0 siblings, 0 replies; 7+ messages in thread
From: AceLan Kao @ 2017-07-24  2:40 UTC (permalink / raw)
  To: Luca Coelho; +Cc: Arend van Spriel, hauke, Luis R. Rodriguez, backports

Yes, I'm compiling the backport driver with bt enabled.
I'll keep all bt related commits until I resolved all the issue.

BTW, the new introduced functions are required by the lib/rhashtable.c

2017-07-22 19:29 GMT+08:00 Luca Coelho <luca@coelho.fi>:
>
>
> On July 22, 2017 10:52:13 AM GMT+03:00, Arend van Spriel <arend.vanspriel@broadcom.com> wrote:
>>On 21-07-17 15:21, Luca Coelho wrote:
>>> On Fri, 2017-07-21 at 14:55 +0800, AceLan Kao wrote:
>>>> add some new kv[mz]alloc functions which introduced after v4.12
>>>> by this commit
>>>>
>>>> commit a7c3e901a46ff54c016d040847eda598a9e3e653
>>>> Author: Michal Hocko <mhocko@suse.com>
>>>> Date:   Mon May 8 15:57:09 2017 -0700
>>>>
>>>>     mm: introduce kv[mz]alloc helpers
>>>>
>>>> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
>>>> ---
>>>
>>> I don't see any backported code using any of these yet... Why do you
>>> need it?
>>
>>AceLan is trying to reinstate BT subsystem/drivers in backports so it
>>may be needed for that. If that is true I think this patch should go in
>>that "BT reinstatement" patch series.
>
>
> Yeah, but I even checked BT stuff and didn't find any occurrences...
>
> --
> Luca.
> --
> To unsubscribe from this list: send the line "unsubscribe backports" in
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] backport: add some new kv[mz]alloc function
  2017-07-21  6:55 [PATCH] backport: add some new kv[mz]alloc function AceLan Kao
  2017-07-21 13:21 ` Luca Coelho
@ 2017-09-06 22:05 ` Hauke Mehrtens
  2017-09-07  2:47   ` AceLan Kao
  1 sibling, 1 reply; 7+ messages in thread
From: Hauke Mehrtens @ 2017-09-06 22:05 UTC (permalink / raw)
  To: AceLan Kao, mcgrof, backports

On 07/21/2017 08:55 AM, AceLan Kao wrote:
> add some new kv[mz]alloc functions which introduced after v4.12
> by this commit
> 
> commit a7c3e901a46ff54c016d040847eda598a9e3e653
> Author: Michal Hocko <mhocko@suse.com>
> Date:   Mon May 8 15:57:09 2017 -0700
> 
>     mm: introduce kv[mz]alloc helpers
> 
> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
> ---
>  backport/backport-include/linux/mm.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
> index 3234b37..8125310 100644
> --- a/backport/backport-include/linux/mm.h
> +++ b/backport/backport-include/linux/mm.h
> @@ -123,4 +123,20 @@ static inline bool page_is_pfmemalloc(struct page *page)
>  }
>  #endif /* < 4.2 */
>  
> +#if LINUX_VERSION_IS_LESS(4,12,0)
> +extern void *kvmalloc_node(size_t size, gfp_t flags, int node);

Is kvmalloc_node() implemented somewhere? It was added in kernel 4.12
and is not available in older mainline kernel versions.

> +static inline void *kvmalloc(size_t size, gfp_t flags)
> +{
> +	return kvmalloc_node(size, flags, NUMA_NO_NODE);
> +}
> +static inline void *kvzalloc_node(size_t size, gfp_t flags, int node)
> +{
> +	return kvmalloc_node(size, flags | __GFP_ZERO, node);
> +}
> +static inline void *kvzalloc(size_t size, gfp_t flags)
> +{
> +	return kvmalloc(size, flags | __GFP_ZERO);
> +}
> +#endif /* < 4.12.0 */
> +
>  #endif /* __BACKPORT_MM_H */
> 

Hauke

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] backport: add some new kv[mz]alloc function
  2017-09-06 22:05 ` Hauke Mehrtens
@ 2017-09-07  2:47   ` AceLan Kao
  0 siblings, 0 replies; 7+ messages in thread
From: AceLan Kao @ 2017-09-07  2:47 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: Luis R. Rodriguez, backports

Sorry, please ignore this patch.
I reverted it in my tree but forgot to send a note out.


2017-09-07 6:05 GMT+08:00 Hauke Mehrtens <hauke@hauke-m.de>:
> On 07/21/2017 08:55 AM, AceLan Kao wrote:
>> add some new kv[mz]alloc functions which introduced after v4.12
>> by this commit
>>
>> commit a7c3e901a46ff54c016d040847eda598a9e3e653
>> Author: Michal Hocko <mhocko@suse.com>
>> Date:   Mon May 8 15:57:09 2017 -0700
>>
>>     mm: introduce kv[mz]alloc helpers
>>
>> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
>> ---
>>  backport/backport-include/linux/mm.h | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/backport/backport-include/linux/mm.h b/backport/backport-include/linux/mm.h
>> index 3234b37..8125310 100644
>> --- a/backport/backport-include/linux/mm.h
>> +++ b/backport/backport-include/linux/mm.h
>> @@ -123,4 +123,20 @@ static inline bool page_is_pfmemalloc(struct page *page)
>>  }
>>  #endif /* < 4.2 */
>>
>> +#if LINUX_VERSION_IS_LESS(4,12,0)
>> +extern void *kvmalloc_node(size_t size, gfp_t flags, int node);
>
> Is kvmalloc_node() implemented somewhere? It was added in kernel 4.12
> and is not available in older mainline kernel versions.
>
>> +static inline void *kvmalloc(size_t size, gfp_t flags)
>> +{
>> +     return kvmalloc_node(size, flags, NUMA_NO_NODE);
>> +}
>> +static inline void *kvzalloc_node(size_t size, gfp_t flags, int node)
>> +{
>> +     return kvmalloc_node(size, flags | __GFP_ZERO, node);
>> +}
>> +static inline void *kvzalloc(size_t size, gfp_t flags)
>> +{
>> +     return kvmalloc(size, flags | __GFP_ZERO);
>> +}
>> +#endif /* < 4.12.0 */
>> +
>>  #endif /* __BACKPORT_MM_H */
>>
>
> Hauke
>
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-09-07  2:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21  6:55 [PATCH] backport: add some new kv[mz]alloc function AceLan Kao
2017-07-21 13:21 ` Luca Coelho
2017-07-22  7:52   ` Arend van Spriel
2017-07-22 11:29     ` Luca Coelho
2017-07-24  2:40       ` AceLan Kao
2017-09-06 22:05 ` Hauke Mehrtens
2017-09-07  2:47   ` AceLan Kao

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.