lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <858b3185-6770-6c46-5efb-53698c913eec@redhat.com>
Date:   Thu, 9 Dec 2021 12:52:56 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Eric Ren <renzhengeek@...il.com>, linux-kernel@...r.kernel.org
Cc:     "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>, Zi Yan <ziy@...dia.com>,
        Gavin Shan <gshan@...hat.com>, Hui Zhu <teawater@...il.com>,
        Sebastien Boeuf <sebastien.boeuf@...el.com>,
        Pankaj Gupta <pankaj.gupta.linux@...il.com>,
        Wei Yang <richard.weiyang@...ux.alibaba.com>,
        virtualization@...ts.linux-foundation.org, linux-mm@...ck.org
Subject: Re: [PATCH v1 2/2] virtio-mem: prepare fake page onlining code for
 granularity smaller than MAX_ORDER - 1

Hi Eric,

thanks for the review!

>>   		if (PageDirty(page)) {
>> -			virtio_mem_clear_fake_offline(pfn + i, max_nr_pages,
>> -						      false);
>> -			generic_online_page(page, MAX_ORDER - 1);
>> +			virtio_mem_clear_fake_offline(pfn + i, 1 << order, false);
>> +			generic_online_page(page, order);
>>   		} else {
>> -			virtio_mem_clear_fake_offline(pfn + i, max_nr_pages,
>> -						      true);
>> -			free_contig_range(pfn + i, max_nr_pages);
>> -			adjust_managed_page_count(page, max_nr_pages);
>> +			virtio_mem_clear_fake_offline(pfn + i, 1 << order, true);
>> +			free_contig_range(pfn + i, 1 << order);
>> +			adjust_managed_page_count(page, 1 << order);
> In the loop, pfn + i, 1 << order are repeatedly calculated. 1 << order 
> is a step size, pfn + i  is each step position.
> Better to figure the numer once each iter?

The compiler better be smart enough to calculate such constants once :)

> 
> LGTL.
> LGTM.
> Reviewed-by: Eric Ren <renzhengeek@...il.com>

Thanks!


-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ