All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH 15/19] powerpc: htab routines for Celleb
Date: Thu, 18 Jan 2007 11:36:29 +1100	[thread overview]
Message-ID: <1169080589.4965.25.camel@localhost.localdomain> (raw)
In-Reply-To: <200701120115.l0C1FPHJ002416@toshiba.co.jp>


> +
> +	dummy0 = beat_lpar_hpte_getword0(slot);
> +	if ((dummy0 & ~0x7FUL) != (want_v & ~0x7FUL)) {
> +		DBG_LOW("not found !\n");
> +		return -1;
> +	}
> +
> +	lpar_rc = beat_write_htab_entry(0, slot, 0, newpp, 0, 7, &dummy0,
> +					&dummy1);
> +	if (lpar_rc != 0 || dummy0 == 0) {
> +		DBG_LOW("not found !\n");
> +		return -1;
> +	}
> +
> +	DBG_LOW("ok %lx %lx\n", dummy0, dummy1);
> +

I just noticed... isn't there a race condition if the HPTE gets evicted
between those two calls and/or replaced by another one ?

That would be generally harmless unless the one replacing it is bolted,
in which case you might override a bolted entry. Fortunately we don't
currently insert much bolted entries after boot, but I still see a
potential for trouble there.

The best solution here is to actually add a function to the hypervisor,
along the line of what I described in my document a while ago, which
atomically compares AVPN and replaces the PP and N bits if it didn't
change.

Another possible issue is that two processors or threads might
continuously evict each other that way I think.

Since the bug only affect your platform and might actually not trigger
at all in the current system since we don't play much with bolted
entries, I'm acking it, but you should look into fixing it.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Cheers,
Ben.

  reply	other threads:[~2007-01-18  0:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12  1:15 [PATCH 15/19] powerpc: htab routines for Celleb Ishizaki Kou
2007-01-18  0:36 ` Benjamin Herrenschmidt [this message]
2007-01-18  7:52   ` Ishizaki Kou
  -- strict thread matches above, loose matches on Subject: below --
2006-12-14  2:46 Ishizaki Kou

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=1169080589.4965.25.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=kou.ishizaki@toshiba.co.jp \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.