Determining the optimal number of threads per core in a multicore processor complex

By optimizing thread distribution based on I/O operations and lock spin time, the method addresses inefficiencies in multicore processor complexes, enhancing performance and reducing latency.

JP7546669B2Active Publication Date: 2024-09-06INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2022528932
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-11-21
Filing Date
2020-11-11
Publication Date
2024-09-06
Estimated Expiration
2040-11-11

AI Technical Summary

Technical Problem

Existing technologies struggle to determine the optimal number of threads per core in a multicore processor complex, leading to inefficiencies in workload distribution and performance optimization.

Method used

A method to determine the optimal number of threads per core based on two processing measurements: I/O operations and lock spin time, adjusting thread availability to optimize performance by increasing threads for higher I/O loads and reducing threads for increased lock contention.

Benefits of technology

Enhances processor performance by maintaining optimal thread utilization, reducing I/O latency, and minimizing lock contention, thereby improving overall system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007546669000004
    Figure 0007546669000004
  • Figure 0007546669000001
    Figure 0007546669000001
  • Figure 0007546669000010
    Figure 0007546669000010
Patent Text Reader

Abstract

A method for determining an optimal number of threads per core in a multi-core processor complex to make available to execute a task includes: determining a first processing measurement based on threads executing on cores of a processor chip, where each core includes circuitry for independently executing multiple threads; determining a number of threads to execute on a core based on the first processing measurement; determining a second processing measurement based on the threads executing on cores of the processor chip; determining an adjustment to the determined number of threads to execute based on the second processing measurement, resulting in an adjusted number of threads; and executing instructions utilizing the adjusted number of threads on the core.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a computer program product, system and method for determining the optimal number of threads per core in a multi-core processor complex to be made available to execute a task. [Background technology]

[0002] In a processor chip or processor complex that offers simultaneous multithreading, multiple cores on the processor chip may each implement multiple threads that can run simultaneously to parallelize the workload. Each core on the processor chip requires hardware for that core, caches, e.g., L1 and L2 caches, and pipeline processing hardware. The threads on a core share the core hardware. Additionally, each thread may have dedicated resources within that core, such as a subset of the pipeline resources, and the threads on that core may share caches, such as the L2 and L3 caches available to a core. Each core may additionally have a dedicated L1 cache.

[0003] Cores on a processor chip can run in different modes to dynamically vary the number of threads on a core that are available for processing or that are left idle. Typically, a user issues commands to control how many threads run on each core, which requires pausing the scheduling of tasks to the core for processing.

[0004] There is a need in the art for improved techniques for determining the optimal number of threads to execute on each core in a multi-core system and varying the threads available for execution on each core to implement the optimal number of threads. Summary of the Invention

[0005] Provided are computer program products, systems and methods for determining an optimal number of threads per core in a multi-core processor complex to make available to execute a task. Determining a first processing measurement based on threads executing on cores of a processor chip, where each core includes circuitry for independently executing a plurality of threads. Determining a number of threads to execute on a core based on the first processing measurement. Determining a second processing measurement based on threads executing on cores of the processor chip. Determining an adjustment to the determined number of threads to execute based on the second processing measurement, resulting in an adjusted number of threads. Executing instructions utilizing the adjusted number of threads on the core.

[0006] According to the above embodiment, an optimal number of threads to run on multiple cores in a multi-core processor is determined based on two different processing measurements to optimize with respect to two different processing attributes: a first processing measurement is used to determine an optimal number of threads to optimize with respect to a first processing factor, and then a second processing measurement is used to adjust the determined optimal number of threads to optimize with respect to the alternative measurement, providing a two-factor optimization.

[0007] In a further embodiment, the first processing measurement includes a number of input / output (I / O) operations from threads executing on a core of the processor complex, and the second processing measurement includes a number of threads executing on the core based on the determined number of I / O operations.

[0008] According to the above embodiment, the optimal number of threads is determined to optimize for the number of I / O operations, which increases the number of available threads when the number of I / O operations increases in order to maintain performance when the I / O load increases.

[0009] In a further embodiment, an association is maintained between a range of lock spin times and an adjustment to the determined number of threads, and an adjustment to the determined number of threads associated with a range of lock spin times that includes the determined lock spin time is determined.

[0010] According to the above embodiment, the optimal number is further adjusted and optimized based on the lock spin time to try to reduce the lock spin time that inhibits performance. As the lock spin time increases, the adjustment to reduce the number of threads increases to reduce the available threads, which reduces the lock contention and the lock spin time of the entire system.

[0011] In a further embodiment, the number of threads to execute on the determined respective cores is less than the number of threads available to execute independently on each respective core, and the task is scheduled to execute only on the determined number of threads on each respective core, leaving at least one thread idle on the multiple cores.

[0012] According to the above embodiment, threads are effectively idled by scheduling tasks to run only on the determined number of threads and not on idle threads, which avoids the need to take processor complexes offline to reconfigure available threads by keeping processor cores online and avoiding using the scheduler to schedule tasks onto idle cores.

[0013] In a further embodiment, the first processing measurement includes lock spin time that a thread executing in the core waits to acquire a lock on a resource, and the second processing measurement includes at least one of a number of I / O operations from threads executing on the core and cross memory bus traffic between the core and shared memory used by the core.

[0014] According to the above embodiment, the optimal number is selected based on the lock spin time so as to reduce the number of threads and thus reduce the lock spin time. Furthermore, the optimal number can be adjusted, e.g., increased, depending on the number of operations to perform a second optimization based on the number of operations.

[0015] Further provided are computer program products, systems and methods for determining an optimal number of threads per core in a multi-core processor complex to be made available to execute a task; determining a number of input / output (I / O) operations from threads executing on cores of the processor complex, where each core includes circuitry for independently executing multiple threads; determining a number of threads to execute on the cores based on the determined number of I / O operations; and executing instructions utilizing the determined number of threads on the cores.

[0016] According to the above embodiment, in order to maintain performance when the number of I / O operations increases, the optimal number of threads is determined based on the number of I / O operations, such that the optimal number is selected based on the level of the number of I / O operations in the complex.

[0017] Further provided are computer program products, systems and methods for determining an optimal number of threads per core in a multi-core processor complex to be made available to execute a task; determining a lock spin time during which threads executing in a core wait to acquire a lock on a computational resource; determining a number of threads to execute on the core based on the determined lock spin time; and utilizing the determined number of threads on the core to execute instructions.

[0018] According to the above embodiment, the optimal number of threads is determined based on the lock spin time that all threads wait to access a computing resource to select the optimal number that reduces lock contention and lock spin time, which improves system performance by reducing the waiting time to acquire a lock. [Brief description of the drawings]

[0019] [Figure 1] FIG. 1 illustrates one embodiment of a computing environment. [Diagram 2] FIG. 2 illustrates one embodiment of thread information for threads implemented within cores of a processor complex. [Diagram 3] FIG. 2 illustrates one embodiment of thread availability information for threads implemented on a core. [Figure 4] FIG. 1 illustrates one embodiment of an optimal number of threads for a range of numbers of input / output (I / O) operations. [Diagram 5] FIG. 13 illustrates one embodiment of an optimal number of threads for the number of I / O operations table. [Figure 6] FIG. 13 illustrates one embodiment of lock spin time adjustment for an optimal number of threads with respect to the range of lock spin time for all threads. [Figure 7] FIG. 13 illustrates one embodiment of a lock spin time adjustment table for adjusting the optimal number of threads. [Figure 8] FIG. 1 illustrates one embodiment of an operation for determining and using an optimal number of threads per core based on the number of I / O operations and lock spin time. [Figure 9] FIG. 13 illustrates an additional embodiment of an operation for determining and using an optimal number of threads per core based on first and second processing measurements. [Figure 10] FIG. 1 illustrates one embodiment of a table of optimal number of threads for lock spin time ranges. [Figure 11] FIG. 13 illustrates an embodiment of an I / O operation number adjustment table for adjusting the optimal number of threads. [Figure 12] FIG. 1 illustrates one embodiment of an operation for determining and using an optimal number of threads per core based on the number of I / O operations. [Figure 13]FIG. 1 illustrates one embodiment of an operation to determine and use an optimal number of threads per core based on lock spin time. [Figure 14] FIG. 2 illustrates a computing environment in which the components of FIG. 1 can be implemented. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0020] The described embodiments provide improvements in computer techniques for determining an optimal number of threads to execute on cores of a processor complex to provide simultaneous multithreading of tasks on the threads. The described embodiments determine an optimal number of threads to execute on cores of a processor complex that takes into account one or more processing metrics to optimize performance based on two different processing metrics.

[0021] The described embodiments provide further refinements to adjusting the optimal number of threads to make available on each processor core by indicating an optimal number of threads per core as available in the thread availability information and indicating other cores as idle, such that tasks are scheduled only to threads in the cores indicated as available, thereby avoiding delays that would result in taking cores offline to reconfigure the available or idle threads in each core, since available and idle threads are indicated in separate thread availability information.

[0022] The described embodiments may determine an optimal number of threads per core to enable that takes into account a number of processing measurements and attributes, such as the number of I / O operations from threads executing on the cores, cross memory bus traffic between cores, shared memory used by the cores, lock spin time that threads executing in the cores spend waiting to acquire locks on resources, etc. In one embodiment, the optimal number of threads may be determined by first determining an optimal number of threads to run on a core based on a determined number of I / O operations, and then determining an adjustment to the determined optimal number of threads to run based on the determined lock spin time that threads spend waiting for a lock on a computational resource to become available.

[0023] FIG. 1 illustrates a multi-processor complex 1021, 1022, ... 102 that can access a shared memory 106 via a memory interface 104. n 1 illustrates an embodiment of a computing system 100 having a processor complex 102. i On-board L1 cache 1101, 1102, 110 m-1 , 110 m A plurality of processing cores 1081, 1082, 108 m-1 , 108 m 1081, 1082 and 108 m-1 , 108 m Each pair of cores in the 1121...1128 L2 cache, such as in the International Business Machines ("IBM"®) POWER9® processor, m / 2 and larger L3 cache 1141...114 m / 2 Each processor complex 102 can share i The L3 cache 114 may include a single chip module (SCM). i may include embedded dynamic random access memory (DRAM).

[0024] Parallelization of workloads and cores 1081, 1082 and 108 m-1 , 108 m 116 threads across i Each core has 108 i Thread 116 i Simultaneous multithreading may include hardware and circuitry for independently executing multiple programs on a single core 108. i But different thread 116 i This allows instructions from multiple processors to be dispatched simultaneously.

[0025] The shared memory 106 is shared by threads 116 i These program components include program components executed by one or more threads of the core 108. i Thread 116 in i Thread manager 120; thread manager 116; i the task scheduler 122 for scheduling tasks on threads; the thread 116 for handling I / O operations and acquiring locks on resources. i thread information 200 with information about the lock spin time that a thread is waiting for; i Top thread 116 i a lock manager 124 that manages access of locks to computational resources 126 in the system 100, such as read / write queues, Least Recently Used (LRU) lists, storage, processing and other computational resources; an optimal thread count for number of I / O operations 400 that provides an optimal number of threads to make available for different ranges of number of I / O operations; and a lock spin time adjustment 600 that provides adjustment of the optimal number of threads for different ranges of lock spin times.

[0026] In alternative embodiments, the arrangement of cores when sharing the L2 and L3 caches may differ from that shown in FIG.

[0027] In the embodiment of FIG. 1, memory 106 includes processor complexes 1021...102 n In an alternative embodiment, each processor complex 102 i However, processor complex 102 i All cores embedded above 108 i Shown within shared memory 106 are program components 120, 122, 124 and data 200, 300, 400, and 500. In a further embodiment, some or all of these program components and information may be stored in the L3 cache 114. i or L2 cache 112 i The L2 cache 112 i Using L1 cache 110 i It can cache data evicted from the L3 cache 114 i Using L2 cache 112 i It is possible to cache data evicted from

[0028] In one embodiment, each processor complex 102 i may hold separate instances of program components 120, 122, 124 and data 200, 300, 400 and 500 in shared memory 106. In a further embodiment, processor complexes 1021...102 n There may be one set of program components 120, 122, 124 and data 200, 300, 400 and 500 to manage the allocation of threads across.

[0029] The term "processor complex" may also be referred to as a "processing unit," "processor," or "processor chip." It is a set of cores 108 that are used to perform tasks within one or more integrated circuit dies. iThread 116 i Additionally, the processor complexes, cores, and threads may include virtual processing components that perform operations on virtual processor complexes, cores, threads, memory, and caches implemented within the physical host processing resources and physical host memory resources.

[0030] In certain embodiments, computing system 100 includes a storage controller that provides access to shared non-volatile storage.

[0031] The memory 106 may include one or more memory devices, either volatile or non-volatile, such as dynamic random access memory (DRAM), phase change memory (PCM), magnetoresistive random access memory (MRAM), spin transfer torque (STT)-MRAM, SRAM storage devices, DRAM, ferroelectric random access memory (FeTRAM), nanowire-based non-volatile memory, and direct in-line memory modules (DIMMs), NAND storage, e.g., flash memory, solid state drive (SSD) storage, non-volatile RAM, etc.

[0032] FIG. 2 illustrates a single processor complex 102. i Core 108 i Thread 116 in i 2 illustrates one embodiment of thread information 200 maintained for a processor complex 102 during a measurement period. i All threads in 1161...116 m Total number of I / O operations performed on all threads 1161...116 m There may be less than 108 cores per iNumber of utilized threads 204, processor complex 102, leaving some threads idle i Number of cores on top 206, total cores 108 i A processor complex 102 implemented in i The maximum number of threads available in the lock manager 124 is 208. All threads 1161...116 m This includes the lock spin time 210 for all threads, such as the number of processor cycles that a thread must wait for a lock to be released.

[0033] FIG. 3 shows a specific core 108 i and thread 116 j Thread availability information maintained for 300 i 4 shows an embodiment of a processor complex 102 that includes a core 302, a thread 304, an idle / available flag 306 that indicates whether the thread 304 is idle and not receiving tasks or whether the thread 304 is available to receive tasks from the task scheduler 122, assigned tasks 308 assigned to the thread 304 on the core 406, and a task queue 310 that queues assigned tasks for the thread 304 to execute. The task scheduler 122 schedules the processor complex 102 i Core 108 i Thread 116 in j You can use load balancing to allocate tasks to multiple processors.

[0034] Figure 4 shows the optimal number of threads for the number of I / O operations. i 4 illustrates one embodiment of a range 402 of I / O operations and a maximum thread adjustment 404 for the range 402. For example, the adjustment 404 may include a percentage of the maximum number of threads 208, which increases for larger ranges of I / O operations because more threads are needed to process more I / O operations to maintain performance of the system 100.

[0035] 5 provides an example of one embodiment of an optimal number of threads for number of I / O operations table 500, such as table 400, that provides different percentages of the maximum number of threads 208 for different ranges of the number of I / O operations, where the optimal number of threads increases for higher ranges of the number of I / O operations.

[0036] FIG. 6 shows an entry 600 in the lock spin time thread adjustment table 600. i 6 illustrates one embodiment of a lock spin time range 602 for all threads during one measurement period, expressed in number of CPU cycles, and a corresponding adjustment 604 to the optimal number of threads. The adjustment 604 can include a percentage decrease in the determined optimal number of threads, where the percentage decrease increases for higher ranges 602 of lock spin time. To reduce wait times due to high levels of lock spin time, the number of active threads is reduced to reduce the amount of lock contention for access to the computational resources 126. Thus, when the lock spin time for all threads increases, the percentage decrease in the optimal number of threads is increased to reduce the number of threads contributing to the lock contention.

[0037] 7 provides an example of one embodiment of an adjustment to the lock spin time thread adjustment table 600 that provides a different percentage reduction for the optimal number of threads, where the percentage reduction increases for higher percentage ranges of the number of CPU cycles spent waiting for a lock, i.e., lock spin time.

[0038] FIG. 8 illustrates which threads 116 are available to the task scheduler 122 to execute tasks and which are idle. i 1 illustrates one embodiment of operations performed by thread manager 120 to determine i Hit thread 116 i8 may be periodically performed to adjust the number of cores 108 to minimize both I / O operation processing latency and lock contention. j Thread 116 for task scheduling in i After initiating the operation to adjust the number of processor complexes 102 during the measurement period (block 802), the thread manager 120 i Core 1081...108 m Threads running on 1161...116 m From an optimal number of threads table 400 for number of I / O operations, such as table 500 (FIG. 5), determine (at block 804) an optimal number of threads 404 that corresponds to a range 402 of number of I / O operations that includes the determined total number of I / O operations for a thread 202. The determined optimal number of threads is 108 for one core. i The maximum number of threads per core was 208, and the number of cores per core was 108 during the measurement period. i A determined entry 400 having a range 402 of I / O operation numbers including the number of I / O operations determined above. i field 404.

[0039] The thread manager 120 then (at block 806) selects the threads for the cores 1081...108. m All running threads in 1161...116 m Determine the lock spin time 210 that each thread will wait to acquire a lock on the computational resource 126. Based on the determined lock spin time, determine (at block 808) an adjustment 604 to the determined optimal number of threads from the lock spin time adjustment table 600. For example, i An entry 600 in a lock spin time adjustment table 600 having a range 602 of lock spin times that includes the determined lock spin time 210 that the i The number of entries was determined to be 600. iThe adjustment 604 is determined from the determined optimal number of threads. The determined adjustment is applied (at block 810) to generate an adjusted optimal number of threads. The adjusted optimal number of threads, which optimizes both I / O operation performance and lock contention, is divided (at block 812) by the number of cores 206 to generate an optimal number of available threads per core. i The thread manager 120 may then (at block 814) i For the optimal number of available threads per core, see Thread Availability Information 300. i Threads are marked as available within core 108 i For threads that are not marked as available in the thread availability information 300 i For example, if there are four threads per core, and three threads is the optimal number of threads per core to have available, then the thread availability information 300 for three threads (the optimal number) is i indicates those threads as available in field 306 and the thread availability information 300 for one thread. i indicates one thread as idle in field 306. During the next measurement period, the number of I / O operations 202 on all threads and the lock spin time 210 for all threads are cleared (at block 816) so that new measurements can be made for use in the next example of operation of FIG. 8 to adjust the optimal number of available threads.

[0040] According to the embodiment of FIG. 8, an optimal number of threads per core to be made available is determined to optimize the number of available threads to minimize I / O operation latency by increasing the number of threads when I / O operations increase in system 100 and decreasing the number of threads when lock spin times increase due to increased lock contention caused by more threads operating in parallel.

[0041] Further described embodiments may include updating thread availability information 300 in memory 106 to indicate available and idle threads in the processor complex 102. i The task scheduler 122 uses thread availability information 300 to avoid delays in adjusting the optimal number of available threads in a task. i Thread 116 marked as available i This schedules tasks only on core 108. i The number of enabled and idle threads per core is updated without the need to reconfigure the

[0042] FIG. 9 illustrates which threads 116 are available to the task scheduler 122 to execute tasks and which are idle. i 1 illustrates an additional embodiment of the operations performed by thread manager 120 to determine i Hit thread 116 i 9 may be periodically performed to adjust the number of cores 108 to optimize with respect to a number of factors. j Thread 116 for task scheduling in i After initiating the operation to adjust the number of threads in the processor complex 102 during the measurement period (block 902), the thread manager 120 i Core 1081...108 m Threads running on 1161...116 m Based on the first process measurement, the cores 1081...108 are determined (at block 904). m Determine the optimal number of threads to run on

[0043] The thread manager 120 may then (at block 906) measure the number of threads in the processor complex 102 during the measurement period. i Core 1081...108 m Threads running on 1161...116 mA second processing measurement is determined based on the first and second processing measurements. An adjustment to the determined optimal number of threads is determined (at block 908) based on the second processing measurement. The determined adjustment is applied (at block 910) to the determined optimal number of threads to generate an adjusted optimal number of threads. The adjusted optimal number of threads, optimized based on both the first and second processing measurements, is divided (at block 912) by the number of cores 206 to generate an optimal number of available threads per core. i The thread manager 120 may then (at block 914) i For the optimal number of available threads per core, see Thread Availability Information 300. i Threads are marked as available within core 108 i For threads that are not marked as available in the thread availability information 300 i For example, if there are four threads per core, and three threads is the optimal number of threads per core to have available, then the thread availability information 300 for three threads (the optimal number) is i indicates those threads as available in field 306 and the thread availability information 300 for one thread. i indicates one thread as idle in field 306. The first and second processing measurements are cleared (at block 916) so that during the next measurement period, a new measurement is made for use in the next example of the operation of FIG. 9 to adjust the optimal number of available threads.

[0044] According to an embodiment of the operations of FIG. 9, an optimal number of threads per core to enable is determined to optimize the number of threads available based on a number of different processor measurements. In one embodiment, the first processing measurement can include at least one of a number of I / O operations from threads executing on the cores, cross memory bus traffic between cores, memory operations, and the like, and the second processing measurement can include lock spin time during which threads executing in the cores wait to acquire a lock on a resource. In a further embodiment, the first processing measurement can include lock spin time during which threads executing in the cores wait to acquire a lock on a resource, and the second processing measurement can include at least one of a number of I / O operations from threads executing on the cores, and cross memory bus traffic between cores, shared memory used by the cores, and the like. To optimize for a number of processing measurements, the first and second processing measurements can also take into account the use of additional computing resources that affect system performance.

[0045] Figures 10 and 11 provide one embodiment of a tuning table when a first processing measurement includes lock spin time, during which threads executing in a core wait to acquire a lock on a resource, and a second processing measurement includes the number of I / O operations from threads executing on a core. Figure 10 shows how the percentage of lock spin time 1002 maps to different numbers of optimal number of threads 1004, where the optimal number of threads is a set of cores 1081...108 m The lock spin time 1002 is calculated as a percentage of the maximum number of available threads 208. Thus, different ranges of lock spin time 1002 map to different percentages 1004 of the maximum number of threads.

[0046] After calculating the optimal number of threads using Figure 10 and the lock spin time, an adjustment to the optimal number of threads can be determined by the range of I / O operation counts shown in Figure 11. Figure 11 shows the adjustment 1104 to the optimal number of threads for different I / O ranges 1102. As the range 1102 of I / O operation counts increases, the adjustment 1104 to the determined optimal number of threads becomes smaller. This is because more threads are required to maintain performance for a larger range of I / O operation counts.

[0047] Figure 12 shows which threads 116 are available to the task scheduler 122 to execute tasks and which are idle. i 1 illustrates an additional embodiment of the operations performed by the thread manager 120 to determine the number of I / O operations based solely on the number of I / O operations per core 108. i Hit thread 116 i 12 may be periodically performed to adjust the number of cores 108 to minimize both I / O operation processing latency and lock contention. j Thread 116 for task scheduling in i After initiating the operation to adjust the number of threads in the processor complex 102 during the measurement period (block 1202), the thread manager 120 i Core 1081...108 m Threads running on 1161...116 m 5. Determine (at block 1204) an optimal number of threads 404 corresponding to a range 402 of I / O operation numbers that includes the determined total number of I / O operations 202 for a thread from an optimal number of threads table 400 for number of I / O operations, such as the table of FIG. 5. The determined optimal number of threads is 108 for one core. i The maximum number of threads per core was 208, and the number of cores per core was 108 during the measurement period. i A determined entry 400 having a range 402 of I / O operation numbers including the number of I / O operations determined above. ifield 404.

[0048] Figure 13 shows which threads are available to the task scheduler 122 to execute tasks and which threads are idle 116. i 2 illustrates an additional embodiment of the operations performed by the thread manager 120 to determine, based solely on the lock spin time 210 that all threads executing on all cores wait to acquire a lock on a computational resource. i Hit thread 116 i 13 may be periodically performed to adjust the number of cores 108 to minimize both I / O operation processing latency and lock contention. j Thread 116 for task scheduling in i After initiating the operation to adjust the number of threads, thread manager 120 (at block 1302) m All running threads in 1161....116 m The program determines (at block 1304) the lock spin time 210 that each thread waits to acquire a lock on a compute resource 126. From the optimal number of threads for lock spin time 1000 (FIG. 10), the program determines a percentage 1004 of the maximum number of threads that constitutes the optimal number of threads that corresponds to the range of lock spin times 1002 that includes the determined lock spin time 210 for all threads 202. The determined optimal number of threads 1004 is the maximum number of threads that corresponds to the range of lock spin times 1002 that includes the determined lock spin time 210 for all threads 202. i 10. The maximum number of threads per thread 208 adjusted by the percentage specified in column 1004 of FIG. 10 with respect to the determined lock spin time range 1002 that includes the determined lock spin time 210 for all threads during the measurement period.

[0049] In the described embodiment, the variables i, j, m, n, etc., when used with different elements, may refer to the same or different instances of that element.

[0050] The invention may be a system, a method, or a computer program product, or a combination thereof. The computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to carry out aspects of the invention.

[0051] The computer readable storage medium may be any tangible device capable of holding and storing instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of computer readable storage media includes portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanically encoded devices such as punch cards or raised structures in grooves having instructions recorded thereon, and any suitable combination thereof. As used herein, a computer-readable storage medium should not be construed as being, itself, a ephemeral signal, such as an electric wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating in a waveguide or other transmission body (e.g., a light pulse traveling in a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0052] The computer readable program instructions described herein may be downloaded from a computer readable storage medium into the respective computing / processing device or may be downloaded to an external computer or storage device over a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may include copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface in each computing / processing device receives the computer readable program instructions from the network and transfers the computer readable program instructions to a computer readable storage medium in the respective computing / processing device for storage.

[0053] The computer readable program instructions for carrying out the operations of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions or state setting data, or may be source or object code written in any combination of one or more programming languages, including object oriented programming languages ​​such as Java®, Smalltalk®, C++, and traditional procedural programming languages ​​such as the "C" programming language or the like. The computer readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or remote server. In the last scenario above, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be effected to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may execute the computer readable program instructions to carry out aspects of the invention by utilizing state information of the computer readable program instructions to personalize the electronic circuitry.

[0054] Aspects of the present invention are described herein with reference to flowchart and / or block diagram illustrations of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of those flowchart and / or block diagram illustrations, and combinations of blocks in those flowchart and / or block diagram illustrations, can be implemented by computer readable program instructions.

[0055] These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, executed by the processor of the computer or other programmable data processing apparatus, generate means for performing the functions / operations specified in one or more blocks of the flowcharts and / or block diagrams. These computer readable program instructions may be stored on a computer readable storage medium, such that the computer readable storage medium in which the instructions are stored includes an article of manufacture including instructions for performing the functions / operations specified in one or more blocks of the flowcharts and / or block diagrams, and direct the computer, programmable data processing apparatus, or other device to function in a particular manner.

[0056] These computer readable program instructions may be loaded into a computer, other programmable data processing apparatus or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer-implemented process such that the instructions, which execute on the computer, other programmable apparatus or other device, perform the functions / operations specified in one or more blocks of the flowcharts and / or block diagrams.

[0057] The flowcharts and block diagrams in the accompanying figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in those flowcharts or block diagrams may represent a module, segment, or portion of instructions, including one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions shown in the blocks may be performed in an order different from that shown in the figures. For example, two blocks shown in succession may in fact be executed substantially simultaneously, or the blocks may sometimes be executed in the reverse order depending on the functionality involved. It should also be noted that each block of those block diagrams and / or flowcharts, as well as combinations of blocks in those block diagrams and / or flowcharts, may be implemented by a hardware-based dedicated system that performs the specified functions or operations or implements a combination of dedicated hardware and computer instructions.

[0058] The computational components of FIG. 1 can be implemented in one or more computer systems, such as computer system 1402 illustrated in FIG. 14. Computer system / server 1402 can be described in the general context of computer system executable instructions, such as program modules, being executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. Computer system / server 1402 can be practiced in a distributed cloud computing environment where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules can be located in both local and remote computer system storage media, including memory storage devices.

[0059] As shown in FIG. 14, a computer system / server 1402 is shown in the form of a general-purpose computing device. The components of the computer system / server 1402 may include, but are not limited to, the processor complex 102 of FIG. i1, a system memory 1406, such as shared memory 106 of FIG. 1, and a bus 1408 that couples various system components including the system memory 1406 to the processor 1404. The bus 1408 represents one or more of several types of bus structures using various bus architectures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor bus or local bus. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0060] Computer system / server 1402 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer system / server 1402 and can include both volatile and nonvolatile media, removable and non-removable media.

[0061] The system memory 1406 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 1410 and / or cache memory 1412. The computer system / server 1402 may further include other removable / non-removable volatile / non-volatile computer system storage media. By way of example only, a storage system 1413 may be provided for reading from and writing to a non-removable, non-volatile magnetic medium (not shown, typically referred to as a "hard drive"). Although not shown, a magnetic disk drive may also be provided for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk"), as well as an optical disk drive for reading from and writing to a removable, non-volatile optical disk, such as a CD-ROM, DVD-ROM, or other optical media. In such case, each may be connected to the bus 1408 by one or more data medium interfaces. As further shown and described below, the memory 1406 may include at least one program product having a set (e.g., at least one) program module configured to perform the functions of the embodiments described herein.

[0062] A set of (at least one) program modules 1416, such as, but not limited to, a program / utility 1414 having an operating system, one or more application programs, other program modules, and program data, can be stored in the memory 1406. Each of the operating system, one or more application programs, other program modules, and program data, or some combination thereof, can include an implementation of a networking environment. Components of the computer 1402 can be generally implemented as program modules 1416 that perform the functions and / or methods of the embodiments of the invention described herein. The system of FIG. 1 can be implemented in one or more computer systems 1402, and when the system of FIG. 1 is implemented in multiple computer systems 1402, the computer systems can communicate over a network.

[0063] The computer system / server 1402 may further communicate with one or more external devices 1418, such as a keyboard, pointing device, display 1420, or the like; one or more devices that allow a user to interact with the computer system / server 1402; or any device that allows the computer system / server 1402 to communicate with one or more other computing devices (e.g., network cards, modems, etc.), or combinations thereof. Such communication may be performed via an input / output (I / O) interface 1422. Additionally, the computer system / server 1402 may communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), or a public network (e.g., the Internet), or combinations thereof, via a network adapter 1424. As shown, the network adapter 1424 communicates with the remaining components of the computer system / server 1402 via a bus 1408. It should be understood that other hardware and / or software components, not shown, may be used with the computer system / server 1402. Examples of such components include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems.

[0064] Unless otherwise specified, the terms "an embodiment," "embodiment," "embodiments," "the embodiment," "the embodiment," "the embodiments," "one or more embodiments," "some embodiments," and "one embodiment" mean "one or more (but not all) embodiments of the present invention."

[0065] Unless expressly stated otherwise, the terms "including," "comprising," "having," and variations of these terms mean "including but not limited to."

[0066] Unless expressly stated to the contrary, an enumerated listing of items does not imply that one or all of the items are mutually exclusive.

[0067] Unless otherwise specified, the terms "a," "an," and "the" mean "one or more."

[0068] Unless specified otherwise, devices that are in communication with each other need not be in continuous communication with each other. In addition, devices that are in communication with each other may communicate directly or indirectly through one or more intermediaries.

[0069] A description of an embodiment including several components in communication with each other does not imply that all such components are required. On the contrary, a variety of optional components are described to illustrate the wide variety of possible embodiments of the present invention.

[0070] It is readily apparent that where a single device or article is described herein, two or more devices / articles may be used in place of the single device / article (whether or not they cooperate). Similarly, where two or more devices or articles are described herein (whether or not they cooperate), it is readily apparent that a single device / article may be used in place of the two or more devices or articles, or that a different number of devices / articles may be used in place of the number of devices or programs shown. Alternatively, the functionality or features or both of a device may be performed by one or more other devices not expressly described as having such functionality / features. Thus, other embodiments of the invention need not include the device itself.

[0071] The above description of various embodiments of the invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teachings. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the scope of the invention, the invention resides in the claims appended hereto.

Claims

1. A computer readable storage medium having computer readable program code embodied therein for determining a number of threads to execute in a core of a processor complex, the computer readable program code, when executed, performing operations, the operations including: determining a first processing measurement based on threads executing on the cores of the processor complex, each core including circuitry for independently executing multiple threads; determining a number of threads to execute on the core based on the first processing measurement; determining a second processing measurement based on the threads executing on the cores of the processor complex; determining an adjustment to the determined number of threads to execute based on the second processing measurement, resulting in an adjusted number of threads; and Executing instructions utilizing the adjusted number of threads on the core. Including, executing instructions utilizing the adjusted number of threads on the core; determining a number of threads to execute on each core based on the adjusted number of threads on the cores, the determined number of threads to execute on each core being less than a number of threads available to execute independently on each core; and scheduling the task to execute only on the determined number of said threads on each of said cores, leaving at least one thread idle on a plurality of said cores; 23. A computer readable storage medium comprising:

2. 2. The computer-readable storage medium of claim 1, wherein the first processing measurement comprises a number of input / output (I / O) operations from threads executing on the cores of the processor complex, and the second processing measurement comprises a lock spin time that the threads executing in the cores wait to acquire a lock on a resource.

3. determining the number of threads to execute maintaining an association between a plurality of ranges of number of I / O operations and an adjustment to a maximum number of threads available to execute on said core; determining an adjustment to the maximum number of threads associated with a range of I / O operation numbers that includes the determined number of I / O operations; and Calculating the determined number of threads by applying the determined adjustment to the maximum number of threads available for execution on the core. The computer readable storage medium of claim 2 .

4. 4. The computer-readable storage medium of claim 3, wherein the throttling comprises reducing the maximum number of threads by a percentage, the percentage decreasing for a higher range of I / O operation numbers.

5. determining the adjustment to the determined number of threads based on the determined lock spin time; maintaining an association between a range of lock spin times and an adjustment to said determined number of threads; and determining an adjustment to the determined number of threads associated with a range of lock spin times that includes the determined lock spin time; The computer readable storage medium of claim 2 .

6. 6. The computer-readable storage medium of claim 5, wherein the adjustment to the determined number of threads comprises reducing the determined number of threads by a percentage, the percentage increasing for a higher range of lock contention times.

7. The operation is further comprising, for each core, indicating a number of threads equal to the determined number of threads to execute as available to receive tasks, and indicating threads in the cores not indicated as available as being idle and unavailable to execute tasks, wherein said scheduling tasks schedules tasks to execute only on threads indicated as available to receive tasks. The computer-readable storage medium of claim 1 .

8. 2. The computer-readable storage medium of claim 1, wherein the first processing measurement comprises a lock spin time that the thread executing in the core waits to acquire a lock on a resource, and the second processing measurement comprises at least one of a number of I / O operations from the thread executing on the core and cross memory bus traffic between the core and a shared memory used by the core.

9. A computer readable storage medium having computer readable program code embodied therein for determining a number of threads to execute in a core of a processor complex, the computer readable program code, when executed, performing operations, the operations including: determining a number of input / output (I / O) operations from threads executing on the cores of the processor complex, each core including circuitry for independently executing multiple threads; determining a number of threads to execute on the core based on the determined number of I / O operations; and Executing instructions utilizing the determined number of threads on the core. Including, determining the number of threads to execute maintaining an association between a plurality of ranges of number of I / O operations and an adjustment to a maximum number of threads available to execute on said core; determining an adjustment to the maximum number of threads associated with a range of I / O operation numbers that includes the determined number of I / O operations; and Calculating the determined number of threads by applying the determined adjustment to the maximum number of threads available for execution on the core.

23. A computer readable storage medium comprising:

10. A computer readable storage medium having computer readable program code embodied therein for determining a number of threads to execute in a core of a processor complex, the computer readable program code, when executed, performing operations, the operations including: determining a lock spin time that the thread executing in the core waits to acquire a lock on a computational resource; determining a number of threads to execute on the core based on the determined lock spin time; and Executing instructions utilizing the determined number of threads on the core. Including, determining the number of threads to execute maintaining an association between a plurality of ranges of lock spin times and an adjustment to a maximum number of threads available to execute on said core; determining an adjustment to the maximum number of threads associated with a range of lock spin times that includes the determined lock spin time; and Calculating the determined number of threads by applying the determined adjustment to the maximum number of threads available for execution on the core.

23. A computer readable storage medium comprising:

11. 1. A system comprising: a processor complex having a plurality of cores for executing threads; A computer readable storage medium having computer readable program code embodied therein; wherein the computer readable program code, when executed on at least one of the cores, performs operations, the operations comprising: determining a first processing measurement based on threads executing on the cores of the processor complex, each core including circuitry for independently executing multiple threads; determining a number of threads to execute on the core based on the first processing measurement; determining a second processing measurement based on the threads executing on the cores of the processor complex; determining an adjustment to the determined number of threads to execute based on the second processing measurement, resulting in an adjusted number of threads; and Executing instructions utilizing the adjusted number of threads on the core. Including, executing instructions utilizing the adjusted number of threads on the core; determining a number of threads to execute on each core based on the adjusted number of threads on the cores, the determined number of threads to execute on each core being less than a number of threads available to execute independently on each core; and scheduling the task to execute only on the determined number of said threads on each of said cores, leaving at least one thread idle on a plurality of said cores; Including, the system.

12. 12. The system of claim 11, wherein the first processing measurement comprises a number of input / output (I / O) operations from threads executing on the cores of the processor complex, and the second processing measurement comprises a lock spin time that the threads executing in the cores wait to acquire a lock on a resource.

13. determining the number of threads to execute maintaining an association between a plurality of ranges of number of I / O operations and an adjustment to a maximum number of threads available to execute on said core; determining an adjustment to the maximum number of threads associated with a range of I / O operation numbers that includes the determined number of I / O operations; and Calculating the determined number of threads by applying the determined adjustment to the maximum number of threads available for execution on the core. The system of claim 12 , comprising:

14. determining the adjustment to the determined number of threads based on the determined lock spin time; maintaining an association between a range of lock spin times and an adjustment to said determined number of threads; and determining an adjustment to the determined number of threads associated with a range of lock spin times that includes the determined lock spin time; The system of claim 12 , comprising:

15. The operation is further comprising, for each core, indicating a number of threads equal to the determined number of threads to execute as available to receive tasks, and indicating threads in the cores not indicated as available as being idle and unavailable to execute tasks, wherein said scheduling tasks schedules tasks to execute only on threads indicated as available to receive tasks. The system of claim 11.

16. 1. A method for determining a number of threads to execute in a core of a processor complex, comprising: determining a first processing measurement based on threads executing on the cores of the processor complex, each core including circuitry for independently executing multiple threads; determining a number of threads to execute on the core based on the first processing measurement; determining a second processing measurement based on the threads executing on the cores of the processor complex; determining an adjustment to the determined number of threads to execute based on the second processing measurement, resulting in an adjusted number of threads; and Executing instructions utilizing the adjusted number of threads on the core. Including, executing instructions utilizing the adjusted number of threads on the core; determining a number of threads to execute on each core based on the adjusted number of threads on the cores, the determined number of threads to execute on each core being less than a number of threads available to execute independently on each core; and scheduling the task to execute only on the determined number of said threads on each of said cores, leaving at least one thread idle on a plurality of said cores; A method comprising:

17. 17. The method of claim 16, wherein the first processing measurement comprises a number of input / output (I / O) operations from threads executing on the cores of the processor complex, and the second processing measurement comprises a lock spin time that the threads executing in the cores wait to acquire a lock on a resource.

18. determining the number of threads to execute maintaining an association between a plurality of ranges of number of I / O operations and an adjustment to a maximum number of threads available to execute on said core; determining an adjustment to the maximum number of threads associated with a range of I / O operation numbers that includes the determined number of I / O operations; and Calculating the determined number of threads by applying the determined adjustment to the maximum number of threads available for execution on the core.

20. The method of claim 17, comprising:

19. determining the adjustment to the determined number of threads based on the determined lock spin time; maintaining an association between a range of lock spin times and an adjustment to said determined number of threads; and determining an adjustment to the determined number of threads associated with a range of lock spin times that includes the determined lock spin time; 20. The method of claim 17, comprising:

20. further comprising, for each core, indicating a number of threads equal to the determined number of threads to execute as available to receive tasks, and indicating threads in the cores not indicated as available as being idle and unavailable to execute tasks, wherein said scheduling tasks schedules tasks to execute only on threads indicated as available to receive tasks.

17. The method of claim 16.

Citation Information

Patent Citations

  • Thread count variation communication apparatus and thread count variation communication program

    JP2018147141A

  • Thread Management in Parallel Processes

    US20130024871A1

  • Processor thread management

    US20160335132A1