linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* How to calculate instruction executed for function
@ 2019-04-03 14:20 Pankaj Suryawanshi
  2019-04-04  9:27 ` Pankaj Suryawanshi
  0 siblings, 1 reply; 2+ messages in thread
From: Pankaj Suryawanshi @ 2019-04-03 14:20 UTC (permalink / raw)
  To: linux-mm, linux-kernel

Hello,

How to calculate instruction executed for function ?

For eg.

I need to calculate instruction executed for CMA_ALLOC function.
How many instruction executed for cma_alloc ?

Any help would be appreciated.

Regards,
Pankaj
************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to calculate instruction executed for function
  2019-04-03 14:20 How to calculate instruction executed for function Pankaj Suryawanshi
@ 2019-04-04  9:27 ` Pankaj Suryawanshi
  0 siblings, 0 replies; 2+ messages in thread
From: Pankaj Suryawanshi @ 2019-04-04  9:27 UTC (permalink / raw)
  To: linux-mm, linux-kernel


________________________________________
From: Pankaj Suryawanshi
Sent: 03 April 2019 19:50
To: linux-mm@kvack.org; linux-kernel@vger.kernel.org
Subject: How to calculate instruction executed for function

Hello,

How to calculate instruction executed for function ?

For eg.

I need to calculate instruction executed for CMA_ALLOC function.
How many instruction executed for cma_alloc ?


CMA_ALLOC :

        for 1 cma_alloc success call there will around 75 instruction is executed, excluding jump, mutex,error case and debug info instruction.

        below are mandatory jump calls that are required for successful allocations.

        cma_bitmap_aligned_mask
        cma_bitmap_aligned_offset
        cma_bitmap_maxno
        cma_bitmap_pages_to_bits
        bitmap_find_next_zero_area_off -> find_next_zero_bit -> find_next_bit
        bitmap_set
        alloc_contig_range -> start_isolate_page_range
        __alloc_contig_migrate_range -> isolate_migratepages_range -> reclaim_clean_pages_from_list -> shrink_page_list -> migrate_pages


        So lets say

        cma_bitmap_aligned_mask  = 1 instrs
        cma_bitmap_aligned_offset = 1 instrs
        cma_bitmap_maxno                  = 1 instrs
        cma_bitmap_pages_to_bits  = 1 instrs

        bitmap_find_next_zero_area_off -> find_next_zero_bit -> find_next_bit = 3 instrs
        bitmap_set  = 1 instrs
        alloc_contig_range -> start_isolate_page_range =

                                has_unmovable_pages = 1 instrs
                                get_pfnblock_flags_mask = 1 instrs
                                set_pageblock_migratetype = 1 instrs
                                move_freepages_block = 1 instrn
                                __mod_zone_page_state = 1 instrs store info in vmstat
                                unset_migratetype_isolate = 1 instrs

        __alloc_contig_migrate_range -> isolate_migratepages_range -> reclaim_clean_pages_from_list -> shrink_page_list -> migrate_pages


        isolate_migratepages_range = 3 instrs
        reclaim_clean_pages_from_list = 2 instrs
        migrate_pages = 1 instrs

        --------------------------------------------------------------
        Total = around 20 instrs per page

        20 ns per page on 1ghz processor is minimum excluding any overheads like mutex, variables, failure/error case,debug/prints.

I roughly calculated this.
Is it Correct ?


Any help would be appreciated.

Regards,
Pankaj
************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-04  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 14:20 How to calculate instruction executed for function Pankaj Suryawanshi
2019-04-04  9:27 ` Pankaj Suryawanshi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).