hi,

> +/*
> + * uncharge all the entries that are charged to the group.
> + */
> +void __swap_cgroup_force_empty(struct mem_cgroup *mem)
> +{
> +     struct swap_info_struct *p;
> +     int type;
> +
> +     spin_lock(&swap_lock);
> +     for (type = swap_list.head; type >= 0; type = swap_info[type].next) {
> +             p = swap_info + type;
> +
> +             if ((p->flags & SWP_ACTIVE) == SWP_ACTIVE) {
> +                     unsigned int i = 0;
> +
> +                     spin_unlock(&swap_lock);

what prevents the device from being swapoff'ed while you drop swap_lock?

YAMAMOTO Takashi

> +                     while ((i = find_next_to_unuse(p, i, mem)) != 0) {
> +                             spin_lock(&swap_lock);
> +                             if (p->swap_map[i] && p->memcg[i] == mem)
> +                                     swap_cgroup_uncharge(p, i);
> +                             spin_unlock(&swap_lock);
> +                     }
> +                     spin_lock(&swap_lock);
> +             }
> +     }
> +     spin_unlock(&swap_lock);
> +
> +     return;
> +}
>  #endif
_______________________________________________
Containers mailing list
[EMAIL PROTECTED]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to