Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1181168
| From | Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] zsmalloc: consider ZS_ALMOST_FULL as migrate source |
| Date | 2015-07-10 04:10 +0200 |
| Message-ID | <pKvVf-8dZ-5@gated-at.bofh.it> (permalink) |
| References | <pKvse-7NE-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On (07/10/15 10:32), Minchan Kim wrote:
> static struct page *isolate_source_page(struct size_class *class)
> {
> struct page *page;
> + int i;
> + bool found = false;
>
why use 'bool found'? just return `page', which will be either NULL
or !NULL?
-ss
> - page = class->fullness_list[ZS_ALMOST_EMPTY];
> - if (page)
> - remove_zspage(page, class, ZS_ALMOST_EMPTY);
> + for (i = ZS_ALMOST_EMPTY; i >= ZS_ALMOST_FULL; i--) {
> + page = class->fullness_list[i];
> + if (!page)
> + continue;
>
> - return page;
> + remove_zspage(page, class, i);
> + found = true;
> + break;
> + }
> +
> + return found ? page : NULL;
> }
-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] zsmalloc: consider ZS_ALMOST_FULL as migrate source Minchan Kim <minchan@kernel.org> - 2015-07-10 03:40 +0200
Re: [PATCH] zsmalloc: consider ZS_ALMOST_FULL as migrate source Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-07-10 04:00 +0200
Re: [PATCH] zsmalloc: consider ZS_ALMOST_FULL as migrate source Minchan Kim <minchan@kernel.org> - 2015-07-10 04:40 +0200
Re: [PATCH] zsmalloc: consider ZS_ALMOST_FULL as migrate source Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2015-07-10 04:10 +0200
Re: [PATCH] zsmalloc: consider ZS_ALMOST_FULL as migrate source Minchan Kim <minchan@kernel.org> - 2015-07-10 04:40 +0200
csiph-web