Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1621908
| From | "Hillf Danton" <hillf.zj@alibaba-inc.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC 5/6] mm, cpuset: always use seqlock when changing task's nodemask |
| Date | 2017-04-12 10:20 +0200 |
| Message-ID | <tvlFo-284-9@gated-at.bofh.it> (permalink) |
| References | <tv4Ey-823-9@gated-at.bofh.it> <tv4Ey-823-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC 5/6] mm, cpuset: always use seqlock when changing task's nodemask Vlastimil Babka <vbabka@suse.cz> - 2017-04-11 16:10 +0200
Re: [RFC 5/6] mm, cpuset: always use seqlock when changing task's nodemask "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-04-12 10:20 +0200
Re: [RFC 5/6] mm, cpuset: always use seqlock when changing task's nodemask Vlastimil Babka <vbabka@suse.cz> - 2017-04-12 10:20 +0200
csiph-web