lkml.org 
[lkml]   [2018]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zsmalloc: fix linking bug in init_zspage
Hi,

On Thu, Aug 09, 2018 at 08:28:17PM -0400, zhouxianrong wrote:
> From: zhouxianrong <zhouxianrong@huawei.com>
>
> The last partial object in last subpage of zspage should not be linked
> in allocation list. Otherwise it could trigger BUG_ON explicitly at
> function zs_map_object. But it happened rarely.

Could you be more specific? What case did you see the problem?
Is it a real problem or one founded by review?

Thanks.

>
> Signed-off-by: zhouxianrong <zhouxianrong@huawei.com>
> ---
> mm/zsmalloc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index 8d87e973a4f5..24dd8da0aa59 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -1040,6 +1040,8 @@ static void init_zspage(struct size_class *class, struct zspage *zspage)
> * Reset OBJ_TAG_BITS bit to last link to tell
> * whether it's allocated object or not.
> */
> + if (off > PAGE_SIZE)
> + link -= class->size / sizeof(*link);
> link->next = -1UL << OBJ_TAG_BITS;
> }
> kunmap_atomic(vaddr);
> --
> 2.13.6
>

\
 
 \ /
  Last update: 2018-08-13 08:06    [W:0.092 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site