Claims
- 1. A method comprising:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors; determining a first thread count; and affinitizing the thread to a first cluster in the N clusters of processors according to the first thread count and the count threshold.
- 2. The method of claim 1 wherein affinitizing comprises:
comparing the first thread count with the count threshold, the first thread count being associated with a current cluster; selecting the first cluster being different than the current cluster if the first thread count exceeds the count threshold; and selecting the first cluster being the current cluster if the first thread count does not exceed the thread count threshold.
- 3. The method of claim 2 wherein affinitizing further comprises:
updating the first thread count.
- 4. The method of claim 2 wherein affinitizing further comprises:
resetting the first thread count if the first thread count exceeds the count threshold.
- 5. The method of claim 1 wherein determining a first thread count comprises:
determining a first thread count as a difference between a total thread count and a system thread count.
- 6. The method of claim 5 wherein affinitizing comprises:
determining an index pointing to the first cluster using the first thread count and the count threshold; and assigning the thread to the first cluster corresponding to the index.
- 7. The method of claim 6 wherein determining an index comprises:
computing a ratio as a function of the first thread count and the count threshold; and converting the ratio into the index such that the index is within a range between 1 and N.
- 8. The method of claim 6 wherein computing a ratio comprises:
adding a constant to the first thread count to produce a sum; and dividing the sum by the count threshold to produce the ratio.
- 9. The method of claim 7 wherein converting the ratio comprises:
converting the ratio into the index using one of a modulo function and a look-up table.
- 10. The method of claim 1 wherein obtaining a count threshold comprises:
obtaining a count threshold as one of a user input and a default setting.
- 11. The method of claim 1 further comprising:
receiving a request from an application to manage the thread affinity.
- 12. The method of claim 11 wherein receiving a request comprises:
receiving a request from an application to manage thread affinity, the request specifying an affinity granularity.
- 13. The method of claim 1 wherein obtaining a count threshold comprises:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, the N clusters of processors operating under an operating system, the thread being created by a virtual machine.
- 14. The method of claim 1 wherein obtaining a count threshold comprises:
obtaining a count threshold for thread affinity of a thread in a cellular multiprocessor system having N clusters of processors.
- 15. The method of claim 1 wherein obtaining a count threshold comprises:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, the N clusters of processors operating under an operating system, the thread being created by a Java™ virtual machine (JVM).
- 16. The method of claim 1 wherein obtaining a count threshold comprises:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, the N clusters of processors operating under a Windows™ operating system, the thread being created by a virtual machine.
- 17. The method of claim 1 wherein obtaining a count threshold comprises:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, each of the N clusters of processors having at least one processor.
- 18. The method of claim 1 wherein affinitizing comprises:
affinitizing a Java™ thread to a first cluster in the N clusters of processors according to the first thread count and the count threshold.
- 19. The method of claim 11 wherein receiving the request comprises:
receiving the request from the application to manage thread affinity via a Java™ virtual machine (JVM) command line.
- 20. The method of claim 1 wherein affinitizing comprises:
creating an affinity mask to correspond to available clusters of processors; and assigning the thread to the first cluster in the N clusters of processors using the affinity mask according to the first thread count and the count threshold.
- 21. An article of manufacture comprising:
a machine-accessible medium including data that, when accessed by a machine, causes the machine to perform operations comprising: obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors; determining a first thread count of active threads; and affinitizing the thread to a first cluster in the N clusters of processors according to the first thread count and the count threshold.
- 22. The article of manufacture of claim 21 wherein the data causing the machine to perform affinitizing comprises data that, when executed by the machine, causes the machine to perform operations comprising:
comparing the first thread count with the count threshold, the first thread count being associated with a current cluster; selecting the first cluster being different than the current cluster if the first thread count exceeds the count threshold; and selecting the first cluster being the current cluster if the first thread count does not exceed the thread count threshold.
- 23. The article of manufacture of claim 22 wherein the data causing the machine to perform affinitizing further comprises data that, when executed by the machine, causes the machine to perform operations comprising:
updating the first thread count.
- 24. The article of manufacture of claim 22 wherein the data causing the machine to perform affinitizing further comprises data that, when executed by the machine, causes the machine to perform operations comprising:
resetting the first thread count if the first thread count exceeds the count threshold.
- 25. The article of manufacture of claim 21 wherein the data causing the machine to perform determining a first thread count comprises data that, when executed by the machine, causes the machine to perform operations comprising:
determining a first thread count as a difference between a total thread count and a system thread count.
- 26. The article of manufacture of claim 25 wherein the data causing the machine to perform affinitizing further comprises data that, when executed by the machine, causes the machine to perform operations comprising:
determining an index pointing to the first cluster using the first thread count and the count threshold; and assigning the thread to the first cluster corresponding to the index.
- 27. The article of manufacture of claim 26 wherein the data causing the machine to perform determining an index comprises data that, when executed by the machine, causes the machine to perform operations comprising:
computing a ratio as a function of the first thread count and the count threshold; and converting the ratio into the index such that the index is within a range between 1 and N.
- 28. The article of manufacture of claim 26 wherein the data causing the machine to perform computing a ratio comprises data that, when executed by the machine, causes the machine to perform operations comprising:
adding a constant to the first thread count to produce a sum; and dividing the sum by the count threshold to produce the ratio.
- 29. The article of manufacture of claim 27 wherein the data causing the machine to perform converting the ratio comprises data that, when executed by the machine, causes the machine to perform operations comprising:
converting the ratio into the index using one of a modulo function and a look-up table.
- 30. The article of manufacture of claim 21 wherein the data causing the machine to perform obtaining a count threshold comprises data that, when executed by the machine, causes the machine to perform operations comprising:
obtaining a count threshold as one of a user input and a default setting.
- 31. The article of manufacture of claim 21 the data, when executed by the machine, further causes the machine to perform operations comprising:
receiving a request from an application to manage thread affinity.
- 32. The article of manufacture of claim 31 wherein the data causing the machine to perform receiving a request comprises data that, when executed by the machine, causes the machine to perform operations comprising:
receiving a request from an application to manage the thread affinity, the request specifying an affinity granularity.
- 33. The article of manufacture of claim 21 wherein the data causing the machine to perform obtaining a count threshold comprises data that, when executed by the machine, causes the machine to perform operations comprising:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, the N clusters of processors operating under an operating system, the thread being created by a virtual machine.
- 34. The article of manufacture of claim 21 wherein the data causing the machine to perform obtaining a count threshold comprises data that, when executed by the machine, causes the machine to perform operations comprising:
obtaining a count threshold for thread affinity of a thread in a cellular multiprocessor system having N clusters of processors.
- 35. The article of manufacture of claim 21 wherein the data causing the machine to perform obtaining a count threshold comprises data that, when executed by the machine, causes the machine to perform operations comprising:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, the N clusters of processors operating under an operating system, the thread being created by a Java™ virtual machine (JVM).
- 36. The article of manufacture of claim 21 wherein the data causing the machine to perform obtaining a count threshold comprises data that, when executed by the machine, causes the machine to perform operations comprising:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, the N clusters of processors operating under a Windows™ operating system, the thread being created by a virtual machine.
- 37. The article of manufacture of claim 21 wherein the data causing the machine to perform obtaining a count threshold comprises data that, when executed by the machine, causes the machine to perform operations comprising:
obtaining a count threshold for thread affinity of a thread in a multiprocessor system having N clusters of processors, each of the N clusters of processors having at least one processor.
- 38. The article of manufacture of claim 21 wherein the data causing the machine to perform affinitizing comprises data that, when executed by the machine, causes the machine to perform operations comprising:
affinitizing a Java™ thread to a first cluster in the N clusters of processors according to the first thread count and the count threshold.
- 39. The article of manufacture of claim 31 wherein the data causing the machine to perform receiving a request comprises data that, when executed by the machine, causes the machine to perform operations comprising:
receiving the request from the application to manage thread affinity via a Java™ virtual machine (JVM) command line.
- 40. The article of manufacture of claim 21 wherein the data causing the machine to perform affinitizing comprises data that, when executed by the machine, causes the machine to perform operations comprising:
creating an affinity mask to correspond to available clusters of processors; and assigning the thread to the first cluster in the N clusters of processors using the affinity mask according to the first thread count and the count threshold.
- 41. A system comprising:
N clusters of processors; and a memory coupled to a processor in the N clusters of processors, the memory containing program code that, when executed by the processor, causes the processor to:
obtain a count threshold for thread affinity of a thread in the N clusters of processors, determine a first thread count of active threads, and affinitize the thread to a first cluster in the N clusters of processors according to the first thread count and the count threshold.
- 42. The system of claim 41 wherein the program code causing the processor to affinitize comprises program code that, when executed by the processor, causes the processor to:
compare the first thread count with the count threshold, the first thread count being associated with a current cluster; select the first cluster being different than the current cluster if the first thread count exceeds the count threshold; and select the first cluster being the current cluster if the first thread count does not exceed the thread count threshold.
- 43. The system of claim 42 wherein the program code causing the processor to affinitize further comprises program code that, when executed by the processor, causes the processor to:
update the first thread count.
- 44. The system of claim 42 wherein the program code causing the processor to affinitize further comprises program code that, when executed by the processor, causes the processor to:
reset the first thread count if the first thread count exceeds the count threshold.
- 45. The system of claim 41 wherein the program code causing the processor to determine a first thread count comprises program code that, when executed by the processor, causes the processor to:
determine a first thread count as a difference between a total thread count and a system thread count.
- 46. The system of claim 45 wherein the program code causing the processor to affinitize comprises program code that, when executed by the processor, causes the processor to:
determine an index pointing to the first cluster using the first thread count and the count threshold; and assign the thread to the first cluster corresponding to the index.
- 47. The system of claim 46 wherein the program code causing the processor to determine an index comprises program code that, when executed by the processor, causes the processor to:
compute a ratio as a function of the first thread count and the count threshold; and convert the ratio into the index such that the index is within a range between 1 and N.
- 48. The system of claim 46 wherein the program code causing the processor to compute a ratio comprises program code that, when executed by the processor, causes the processor to:
add a constant to the first thread count to produce a sum; and divide the sum by the count threshold to produce the ratio.
- 49. The system of claim 47 wherein the program code causing the processor to convert the ratio comprises program code that, when executed by the processor, causes the processor to:
convert the ratio into the index using one of a modulo function and a look-up table.
- 50. The system of claim 41 wherein the program code causing the processor to obtain a count threshold comprises program code that, when executed by the processor, causes the processor to:
obtain a count threshold as one of a user input and a default setting.
- 51. The system of claim 41 the program code further causes the processor to:
receive a request from an application to manage thread affinity.
- 52. The system of claim 51 wherein the program code causing the processor to receive a request comprises program code that, when executed by the processor, causes the processor to:
receive a request from an application to manage the thread affinity, the request specifying an affinity granularity.
- 53. The system of claim 41 wherein the program code causing the processor to obtain a count threshold comprises program code that, when executed by the processor, causes the processor to:
obtain a count threshold for thread affinity of a thread for the N clusters of processors, the N clusters of processors operating under an operating system, the thread being created by a virtual machine.
- 54. The system of claim 41 wherein the program code causing the processor to obtain a count threshold comprises program code that, when executed by the processor, causes the processor to:
obtain a count threshold for thread affinity of a thread in the N clusters of processors forming a cellular multiprocessor system.
- 55. The system of claim 41 wherein the program code causing the processor to obtain a count threshold comprises program code that, when executed by the processor, causes the processor to:
obtain a count threshold for thread affinity of a thread in the N clusters of processors, the N clusters of processors operating under an operating system, the thread being created by a Java virtual machine (JVM).
- 56. The system of claim 41 wherein the program code causing the processor to obtain a count threshold comprises program code that, when executed by the processor, causes the processor to:
obtain a count threshold for thread affinity of a thread in the N clusters of processors, the N clusters of processors operating under a Windows™ operating system, the thread being created by a virtual machine.
- 57. The system of claim 41 wherein the program code causing the processor to obtain a count threshold comprises program code that, when executed by the processor, causes the processor to:
obtain a count threshold for thread affinity of a thread in the N clusters of processors, each of the N clusters of processors having at least one processor.
- 58. The system of claim 41 wherein the program code causing the processor to affinitize comprises program code that, when executed by the processor, causes the processor to:
affinitize a Java™ thread to a first cluster in the N clusters of processors according to the first thread count and the count threshold.
- 59. The system of claim 51 wherein the program code causing the processor to receive the request comprises program code that, when executed by the processor, causes the processor to:
receive the request from the application to manage thread affinity via a Java™ virtual machine (JVM) command line.
- 60. The system of claim 41 wherein the program code causing the processor to affinitize comprises program code that, when executed by the processor, causes the processor to:
create an affinity mask to correspond to available clusters of processors; and assign the thread to the first cluster in the N clusters of processors using the affinity mask according to the first thread count and the count threshold.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application is a continuation-in-part of the application Ser. No. 10/209,454 (Attorney Docket No. 620-L) entitled “Method And System For Managing Distribution Of Computer-Executable Program Threads Between Central Processing Units In A Multi-Central Processing Unit Computer System”, filed on Jul. 30, 2002, and assigned to the same assignee. This application is related to the following patent applications: Ser. No. ______ (Attorney Docket No. 616-L/006342.P002) entitled “SELECTING PROCESSOR CONFIGURATION BASED ON THREAD USAGE IN A MUTLIPROCESSOR SYSTEM”; Ser. No. ______ (Attorney Docket No. 618L/006342.P003) entitled “DYNAMICALLY GENERATING MASKS FOR THREAD SCHEDULING IN A MULTIPROCESSOR SYSTEM”, all filed on the same date and assigned to the same assignee as the present application, the contents of each of which are herein incorporated by reference.
Continuation in Parts (1)
|
Number |
Date |
Country |
Parent |
10209454 |
Jul 2002 |
US |
Child |
10334368 |
Dec 2002 |
US |