m is the current OS thread (m stands for machine;
in the Plan 9 kernel it was the variable name for the
current processor's Mach structure), like u in the
original Unix kernel.
g is usually the current goroutine, but it's real purpose
is to be the definitive place to find the current stack
bounds during the stack growth check at the beginning
of most functions.
m->curg is often == g, but not always. When
the stack is out of space and needs to be grown,
the code switches to g == m->g0 in order to have
some stack in which to work, and then it switches
back to m->curg when done.
It would be possible to introduce another field in m
instead of having the separate g, but that would
require another memory reference in each function
prologue, and the single word of memory is not
expensive.
Russ