lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 27 Nov 2012 17:29:09 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Li Zhong <zhong@...ux.vnet.ibm.com>
Cc:	linux-next list <linux-next@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>, paulmck@...ux.vnet.ibm.com,
	sasha.levin@...cle.com, gleb@...hat.com, avi@...hat.com
Subject: Re: [RFC PATCH] Fix abnormal rcu dynticks_nesting values related to
 async page fault

2012/11/27 Li Zhong <zhong@...ux.vnet.ibm.com>:
> @@ -247,10 +247,17 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code)
>                 break;
>         case KVM_PV_REASON_PAGE_NOT_PRESENT:
>                 /* page is swapped out by the host. */
> -               rcu_irq_enter();
> +               if (is_idle_task(current) && rcu_is_cpu_idle())

If the task is idle we can't schedule so I guess we don't need to call
rcu_idle_exit()

> +                       rcu_idle_exit();
> +               else
> +                       rcu_user_exit();

rcu_user_exit() must be called in any case yeah.

> +
>                 exit_idle();
>                 kvm_async_pf_task_wait((u32)read_cr2());
> -               rcu_irq_exit();
> +
> +               if (is_idle_task(current) && rcu_is_cpu_idle())
> +                       rcu_idle_enter();
> +

I think that only adding rcu_user_exit() in the beginning and let the
rest as is (rcu_irq_enter() / rcu_irq_exit()) is enough. If we are
idle we won't schedule out. If we are not idle then we exit rcu user
mode if necessary and we can call rcu_irq_enter() in any case. If we
schedule we can safely cal rcu_irq_exit() even if somebody called
rcu_idle_enter() / rcu_idle_exit() since our matching rcu_irq_enter()
called before we scheduled. This works because we are not in RCU idle
mode and Paul says this is legal to have irq exit without matching irq
entry (his famous "vice-versa" on his previous email ;-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ