From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>,
alistair@popple.id.au, aneesh.kumar@linux.vnet.ibm.com,
linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au
Subject: Re: [RFC 2/2] cxl: Mark context requiring global TLBIs
Date: Sun, 7 May 2017 12:41:38 +0200 [thread overview]
Message-ID: <6f269c40-c72a-8415-21e1-058c91a43f6b@linux.vnet.ibm.com> (raw)
In-Reply-To: <1493883553.7934.5.camel@gmail.com>
Le 04/05/2017 à 09:39, Balbir Singh a écrit :
> On Wed, 2017-05-03 at 16:29 +0200, Frederic Barrat wrote:
>> The PSL needs to see all TLBI pertinent to the memory contexts used on
>> the cxl adapter. For the hash memory model, it was done by making all
>> TLBIs global as soon as the cxl driver is in us. For radix, we need
>> something similar, but we can refine and only convert to global the
>> invalidations for contexts actually used by the device.
>>
>> So mark the contexts being attached to the cxl adapter as requiring
>> global TLBIs.
>>
> <snip>
>> +#ifdef CONFIG_PPC_BOOK3S_64
>> + if (ctx->mm)
>> + mm_context_set_global_tlbi(&ctx->mm->context);
>
> Just curious and wondering
>
> Could we do mm_context_set_global_tlbi() before ->attach_process() that
> way we won't need atomic tests (set_bit() and test_bit())? May be a memory
> barrier would suffice. Not 100% sure, hence checking
You're right, I need to move mm_context_set_global_tlbi() before the
attach and have a write memory barrier.
If the attach fails, then the context will still be marked for global
TLBIs (some other driver may also set the bit for a different reason).
But I would expect the life expectancy of a process designed to use an
accelerator and failing to attach to be pretty short.
I still think we need the atomic set_bit() though, but that's really for
the future and if somebody introduces new bits in the context 'flags'.
Fred
> Balbir Singh.
>
next prev parent reply other threads:[~2017-05-07 10:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 14:29 [RFC 0/2] powerpc/mm: Mark memory contexts requiring global TLBIs Frederic Barrat
2017-05-03 14:29 ` [RFC 1/2] powerpc/mm: Add marker for contexts requiring global TLB invalidations Frederic Barrat
2017-05-04 6:41 ` Aneesh Kumar K.V
2017-05-04 17:24 ` Frederic Barrat
2017-05-04 7:25 ` Balbir Singh
2017-05-04 9:24 ` Michael Ellerman
2017-05-04 9:42 ` Michael Ellerman
2017-05-07 11:15 ` Frederic Barrat
2017-05-03 14:29 ` [RFC 2/2] cxl: Mark context requiring global TLBIs Frederic Barrat
2017-05-04 7:39 ` Balbir Singh
2017-05-07 10:41 ` Frederic Barrat [this message]
2017-05-05 5:28 ` [RFC 0/2] powerpc/mm: Mark memory contexts " Alistair Popple
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=6f269c40-c72a-8415-21e1-058c91a43f6b@linux.vnet.ibm.com \
--to=fbarrat@linux.vnet.ibm.com \
--cc=alistair@popple.id.au \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=bsingharora@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).