Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1412150
| From | Vlastimil Babka <vbabka@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v7 11/12] zsmalloc: page migration support |
| Date | 2016-06-02 13:50 +0200 |
| Message-ID | <rFzip-5oX-19@gated-at.bofh.it> (permalink) |
| References | <rF1gJ-An-3@gated-at.bofh.it> <rF1gK-An-13@gated-at.bofh.it> <rFf0l-Xx-21@gated-at.bofh.it> <rFoGl-7g3-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 06/02/2016 02:25 AM, Minchan Kim wrote:
> On Wed, Jun 01, 2016 at 04:09:26PM +0200, Vlastimil Babka wrote:
>> On 06/01/2016 01:21 AM, Minchan Kim wrote:
>>> + reset_page(page);
>>> + put_page(page);
>>> + page = newpage;
>>> +
>>> + ret = 0;
>>> +unpin_objects:
>>> + for (addr = s_addr + offset; addr < s_addr + pos;
>>> + addr += class->size) {
>>> + head = obj_to_head(page, addr);
>>> + if (head & OBJ_ALLOCATED_TAG) {
>>> + handle = head & ~OBJ_ALLOCATED_TAG;
>>> + if (!testpin_tag(handle))
>>> + BUG();
>>> + unpin_tag(handle);
>>> + }
>>> + }
>>> + kunmap_atomic(s_addr);
>>
>> The above seems suspicious to me. In the success case, page points to
>> newpage, but s_addr is still the original one?
>
> s_addr is virtual adress of old page by kmap_atomic so page pointer of
> new page doesn't matter.
Hmm, I see. The value (head address/handle) it reads from the old page
should be the same as the one in the newpage. And this value doesn't get
changed in the process. So it works, it's just subtle :)
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v7 11/12] zsmalloc: page migration support Minchan Kim <minchan@kernel.org> - 2016-06-01 01:30 +0200
Re: [PATCH v7 11/12] zsmalloc: page migration support Vlastimil Babka <vbabka@suse.cz> - 2016-06-01 16:10 +0200
Re: [PATCH v7 11/12] zsmalloc: page migration support Minchan Kim <minchan@kernel.org> - 2016-06-02 02:30 +0200
Re: [PATCH v7 11/12] zsmalloc: page migration support Vlastimil Babka <vbabka@suse.cz> - 2016-06-02 13:50 +0200
Re: [PATCH v7 11/12] zsmalloc: page migration support Andrew Morton <akpm@linux-foundation.org> - 2016-06-01 23:40 +0200
Re: [PATCH v7 11/12] zsmalloc: page migration support Minchan Kim <minchan@kernel.org> - 2016-06-02 02:20 +0200
csiph-web