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:   Wed, 12 Apr 2017 16:10:53 +0800
From:   "Hillf Danton" <hillf.zj@...baba-inc.com>
To:     "'Vlastimil Babka'" <vbabka@...e.cz>, <linux-mm@...ck.org>
Cc:     <linux-kernel@...r.kernel.org>, <cgroups@...r.kernel.org>,
        "'Li Zefan'" <lizefan@...wei.com>,
        "'Michal Hocko'" <mhocko@...nel.org>,
        "'Mel Gorman'" <mgorman@...hsingularity.net>,
        "'David Rientjes'" <rientjes@...gle.com>,
        "'Christoph Lameter'" <cl@...ux.com>,
        "'Hugh Dickins'" <hughd@...gle.com>,
        "'Andrea Arcangeli'" <aarcange@...hat.com>,
        "'Anshuman Khandual'" <khandual@...ux.vnet.ibm.com>,
        "'Kirill A. Shutemov'" <kirill.shutemov@...ux.intel.com>
Subject: Re: [RFC 5/6] mm, cpuset: always use seqlock when changing task's nodemask

On April 11, 2017 10:06 PM Vlastimil Babka wrote: 
> 
>  static void cpuset_change_task_nodemask(struct task_struct *tsk,
>  					nodemask_t *newmems)
>  {
> -	bool need_loop;
> -
>  	task_lock(tsk);
> -	/*
> -	 * Determine if a loop is necessary if another thread is doing
> -	 * read_mems_allowed_begin().  If at least one node remains unchanged and
> -	 * tsk does not have a mempolicy, then an empty nodemask will not be
> -	 * possible when mems_allowed is larger than a word.
> -	 */
> -	need_loop = task_has_mempolicy(tsk) ||
> -			!nodes_intersects(*newmems, tsk->mems_allowed);
> 
> -	if (need_loop) {
> -		local_irq_disable();
> -		write_seqcount_begin(&tsk->mems_allowed_seq);
> -	}
> +	local_irq_disable();
> +	write_seqcount_begin(&tsk->mems_allowed_seq);
> 
> -	nodes_or(tsk->mems_allowed, tsk->mems_allowed, *newmems);
>  	mpol_rebind_task(tsk, newmems);
>  	tsk->mems_allowed = *newmems;
> 
> -	if (need_loop) {
> -		write_seqcount_end(&tsk->mems_allowed_seq);
> -		local_irq_enable();
> -	}
> +	write_seqcount_end(&tsk->mems_allowed_seq);
> 
Doubt if we'd listen irq again.

>  	task_unlock(tsk);
>  }
> --
> 2.12.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ