Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1353147

Re: Suspicious error for CMA stress test

From Joonsoo Kim <js1304@gmail.com>
Newsgroups linux.kernel
Subject Re: Suspicious error for CMA stress test
Date 2016-03-08 16:40 +0100
Message-ID <rarTQ-2Ho-9@gated-at.bofh.it> (permalink)
References (7 earlier) <r8Sv8-3eE-9@gated-at.bofh.it> <r9V7z-6sn-1@gated-at.bofh.it> <ra2Vt-2Xn-13@gated-at.bofh.it> <rakyZ-6iA-13@gated-at.bofh.it> <rannb-87S-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-03-08 19:45 GMT+09:00 Xishi Qiu <qiuxishi@huawei.com>:
> On 2016/3/8 15:48, Joonsoo Kim wrote:
>
>> On Mon, Mar 07, 2016 at 01:59:12PM +0100, Vlastimil Babka wrote:
>>> On 03/07/2016 05:34 AM, Joonsoo Kim wrote:
>>>> On Fri, Mar 04, 2016 at 03:35:26PM +0800, Hanjun Guo wrote:
>>>>>> Sad to hear that.
>>>>>>
>>>>>> Could you tell me your system's MAX_ORDER and pageblock_order?
>>>>>>
>>>>>
>>>>> MAX_ORDER is 11, pageblock_order is 9, thanks for your help!
>>>
>>> I thought that CMA regions/operations (and isolation IIRC?) were
>>> supposed to be MAX_ORDER aligned exactly to prevent needing these
>>> extra checks for buddy merging. So what's wrong?
>>
>> CMA isolates MAX_ORDER aligned blocks, but, during the process,
>> partialy isolated block exists. If MAX_ORDER is 11 and
>> pageblock_order is 9, two pageblocks make up MAX_ORDER
>> aligned block and I can think following scenario because pageblock
>> (un)isolation would be done one by one.
>>
>> (each character means one pageblock. 'C', 'I' means MIGRATE_CMA,
>> MIGRATE_ISOLATE, respectively.
>>
>
> Hi Joonsoo,
>
>> CC -> IC -> II (Isolation)
>
>> II -> CI -> CC (Un-isolation)
>>
>> If some pages are freed at this intermediate state such as IC or CI,
>> that page could be merged to the other page that is resident on
>> different type of pageblock and it will cause wrong freepage count.
>>
>
> Isolation will appear when do cma alloc, so there are two following threads.
>
> C(free)C(used) -> start_isolate_page_range -> I(free)C(used) -> I(free)I(someone free it) -> undo_isolate_page_range -> C(free)C(free)
> so free cma is 2M -> 0M -> 0M -> 4M, the increased 2M was freed by someone.

Your example is correct one but think about following one.
C(free)C(used) -> start_isolate_page_range -> I(free)C(used) ->
I(free)**C**(someone free it) -> undo_isolate_page_range ->
C(free)C(free)

it would be 2M -> 0M -> 2M -> 6M.
When we do I(free)C(someone free it), CMA freepage is added
because it is on CMA pageblock. But, bad merging happens and
4M buddy is made and it is in isolate buddy list.
Later, when we do undo_isolation, this 4M buddy is moved to
CMA buddy list and 4M is added to CMA freepage counter so
total is 6M.

Thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Suspicious error for CMA stress test Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-03-07 05:40 +0100
  Re: Suspicious error for CMA stress test "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com> - 2016-03-07 09:20 +0100
    Re: Suspicious error for CMA stress test Laura Abbott <labbott@redhat.com> - 2016-03-07 19:50 +0100
      Re: Suspicious error for CMA stress test "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com> - 2016-03-08 03:00 +0100
        Re: Suspicious error for CMA stress test "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com> - 2016-03-09 02:30 +0100
          Re: Suspicious error for CMA stress test Joonsoo Kim <js1304@gmail.com> - 2016-03-11 16:10 +0100
            Re: Suspicious error for CMA stress test Vlastimil Babka <vbabka@suse.cz> - 2016-03-11 18:10 +0100
              Re: Suspicious error for CMA stress test Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-03-14 07:50 +0100
                Re: Suspicious error for CMA stress test Vlastimil Babka <vbabka@suse.cz> - 2016-03-14 08:10 +0100
                Re: Suspicious error for CMA stress test Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-03-14 08:20 +0100
                Re: Suspicious error for CMA stress test Vlastimil Babka <vbabka@suse.cz> - 2016-03-14 13:40 +0100
                Re: Suspicious error for CMA stress test Joonsoo Kim <js1304@gmail.com> - 2016-03-14 15:20 +0100
                Re: Suspicious error for CMA stress test Vlastimil Babka <vbabka@suse.cz> - 2016-03-16 13:10 +0100
                Re: Suspicious error for CMA stress test Hanjun Guo <guohanjun@huawei.com> - 2016-03-16 10:50 +0100
                Re: Suspicious error for CMA stress test Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-03-17 08:00 +0100
                Re: Suspicious error for CMA stress test Hanjun Guo <guohanjun@huawei.com> - 2016-03-17 10:30 +0100
                Re: Suspicious error for CMA stress test Joonsoo Kim <js1304@gmail.com> - 2016-03-17 16:40 +0100
                Re: Suspicious error for CMA stress test Vlastimil Babka <vbabka@suse.cz> - 2016-03-17 16:50 +0100
                Re: Suspicious error for CMA stress test Joonsoo Kim <js1304@gmail.com> - 2016-03-17 17:00 +0100
    Re: Suspicious error for CMA stress test Hanjun Guo <hanjun.guo@linaro.org> - 2016-03-08 05:10 +0100
  Re: Suspicious error for CMA stress test Vlastimil Babka <vbabka@suse.cz> - 2016-03-07 14:00 +0100
    Re: Suspicious error for CMA stress test Joonsoo Kim <iamjoonsoo.kim@lge.com> - 2016-03-08 08:50 +0100
      Re: Suspicious error for CMA stress test Xishi Qiu <qiuxishi@huawei.com> - 2016-03-08 11:50 +0100
        Re: Suspicious error for CMA stress test Joonsoo Kim <js1304@gmail.com> - 2016-03-08 16:40 +0100
          Re: Suspicious error for CMA stress test Xishi Qiu <qiuxishi@huawei.com> - 2016-03-09 03:20 +0100

csiph-web