Re: [PATCH 1/5] rcu,nohz: add state parameter to context_tracking_user_enter/exit

From: Rik van Riel
Date: Fri Feb 06 2015 - 13:52:15 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/06/2015 01:23 PM, Frederic Weisbecker wrote:
> On Fri, Feb 06, 2015 at 01:20:21PM -0500, Rik van Riel wrote: On
> 02/06/2015 12:22 PM, Frederic Weisbecker wrote:
>>>> On Thu, Feb 05, 2015 at 03:23:48PM -0500, riel@xxxxxxxxxx
>>>> wrote:
>>>>> From: Rik van Riel <riel@xxxxxxxxxx>
>>>>>
>>>>> Add the expected ctx_state as a parameter to
>>>>> context_tracking_user_enter and
>>>>> context_tracking_user_exit, allowing the same functions to
>>>>> not just track kernel <> user space switching, but also
>>>>> kernel <> guest transitions.
>>>>>
>>>>> Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>
>>>>
>>>> You should consider using guest_enter() and guest_exit()
>>>> instead. These are context tracking APIs too but specifically
>>>> for guest.
>
> What do you mean instead? KVM already uses those.
>
> I just wanted to avoid duplicating the code...
>
>> I mean you can call rcu_user APIs directly from
>> guest_enter/exit. You don't really need to call the
>> context_tracking_user functions since guest_enter/guest_exit
>> already handle the vtime accounting.

I would still have to modify exception_enter and exception_exit,
and with them context_tracking_user_enter and
context_tracking_user_exit.

We have to re-enable RCU when an exception happens.

I suspect exceptions in a guest just trigger VMEXIT, and we
figure later why the exception happened. However, if we were
to get an exception during the code where we transition into
or out of guest mode, we would still need exception_enter
and exception_exit...

- --
All rights reversed
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJU1Q1MAAoJEM553pKExN6DB90H/iVCnfrooAB15E5Qioa3Ty+X
hNMaIMX6zjYg++IFR5BhYLp9hp36o/98sv8RLTjZQix2q1ljivobmbABvx2MBNhx
NiPfU9DyBkhz3gwI4oTkggb383Wrcyt+RgvclI/96AbwkhrdzxmT1nnUc0kA98xC
6NTW2+imkYX31sY/2SFmYWnJMVZOjOIep3LCVh/hrWnQARd6mdyzzFr+v6Z/vyFe
8P2rbqlkN0nf1pGYz3VF6zqF8wVmOi1mx4mo0qy80Sax7jsZv9+gGfbF1HkHJnjg
FLsj/q/mcrH1GBK54a3s3P6ghpcFXfwibjhkGmrmA07XNHqLiNgKgmgPtArhU+s=
=9Ln1
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/