Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: nmspinning's position in struct schedt #38858

Open
mygrsun opened this issue May 4, 2020 · 2 comments
Open

runtime: nmspinning's position in struct schedt #38858

mygrsun opened this issue May 4, 2020 · 2 comments
Milestone

Comments

@mygrsun
Copy link

@mygrsun mygrsun commented May 4, 2020

i think the nmspinning's position in struct schedt in runtime should be writen in the "m" part instead of "p" part

current is

	midle        muintptr // idle m's waiting for work
	nmidle       int32    // number of idle m's waiting for work
	nmidlelocked int32    // number of locked m's waiting for work
	mnext        int64    // number of m's that have been created and next M ID
	maxmcount    int32    // maximum number of m's allowed (or die)
	nmsys        int32    // number of system m's not counted for deadlock
	nmfreed      int64    // cumulative number of freed m's

	ngsys uint32 // number of system goroutines; updated atomically

	pidle      puintptr // idle p's
	npidle     uint32
	nmspinning uint32 // See "Worker thread parking/unparking" comment in proc.go.

i think it should like this:

	midle        muintptr // idle m's waiting for work
	nmidle       int32    // number of idle m's waiting for work
	nmidlelocked int32    // number of locked m's waiting for work
	mnext        int64    // number of m's that have been created and next M ID
	maxmcount    int32    // maximum number of m's allowed (or die)
	nmsys        int32    // number of system m's not counted for deadlock
	nmfreed      int64    // cumulative number of freed m's
	nmspinning uint32 // See "Worker thread parking/unparking" comment in proc.go.

	ngsys uint32 // number of system goroutines; updated atomically

	pidle      puintptr // idle p's
	npidle     uint32
@dmitshur
Copy link
Member

@dmitshur dmitshur commented May 8, 2020

Thanks for reporting. Is this just a suggested readability improvement, or do you think there is another problem there?

/cc @aclements

@dmitshur dmitshur added this to the Backlog milestone May 8, 2020
@mygrsun
Copy link
Author

@mygrsun mygrsun commented May 9, 2020

suggested readability improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.