[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled
On 11/30/2017 06:45 PM, Tetsuo Handa wrote:
Wei Wang wrote:@@ -652,7 +652,9 @@ static void report_free_page(struct work_struct *work) /* Start by sending the obtained cmd id to the host with an outbuf */ send_one_desc(vb, vb->free_page_vq, virt_to_phys(&vb->start_cmd_id), sizeof(uint32_t), false, true, false); - walk_free_mem_block(vb, 0, &virtio_balloon_send_free_pages); + if (!(page_poisoning_enabled() && + !IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY)))I think that checking IS_ENABLED() before checking page_poisoning_enabled() would generate better code, for IS_ENABLED() is build-time constant while page_poisoning_enabled() is a function which the compiler assumes that we need to call page_poisoning_enabled() even if IS_ENABLED() is known to be 0. if (IS_ENABLED(CONFIG_PAGE_POISONING_NO_SANITY) || !page_poisoning_enabled())
Agree, thanks. Best, Wei
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]