9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Yoann Padioleau <pad@fb.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] minor kernel bug
Date: Thu,  5 Jun 2014 00:56:22 +0000	[thread overview]
Message-ID: <4836971E-CA9D-4282-BC5E-4596E0A3EB2B@fb.com> (raw)

Hi,

Here is a patch for tasklock.c:

int
lock(Lock *l)
{
	int i;
	ulong pc;

	pc = getcallerpc(&l);

	lockstats.locks++;
	if(up)
		inccnt(&up->nlocks);	/* prevent being scheded */
	if(tas(&l->key) == 0){
		if(up)
			up->lastlock = l;
		l->pc = pc;
		l->p = up;
		l->isilock = 0;
+            	l->m = MACHP(m->machno);
...
		return 0;
	}

we do that in ilock() and canlock() so it's a bug I think to not do it also in lock().
The field is only used in iprintcanlock which use canlock(), not lock(), so this
if fine, but for consistency it would be better to also do it in lock() no?





             reply	other threads:[~2014-06-05  0:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  0:56 Yoann Padioleau [this message]
2014-06-05 11:19 ` erik quanstrom
2014-06-05 11:21 ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4836971E-CA9D-4282-BC5E-4596E0A3EB2B@fb.com \
    --to=pad@fb.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).