]> Pileus Git - ~andy/linux/blobdiff - fs/exec.c
[PATCH] cpusets: bitmap and mask remap operators
[~andy/linux] / fs / exec.c
index d2208f7c87db81c30d8bdd3ddf965e887f693e4a..fc02dadc604a8685b97424d592465dcba691d8a4 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -309,40 +309,36 @@ void install_arg_page(struct vm_area_struct *vma,
        pud_t * pud;
        pmd_t * pmd;
        pte_t * pte;
+       spinlock_t *ptl;
 
        if (unlikely(anon_vma_prepare(vma)))
-               goto out_sig;
+               goto out;
 
        flush_dcache_page(page);
        pgd = pgd_offset(mm, address);
-
-       spin_lock(&mm->page_table_lock);
        pud = pud_alloc(mm, pgd, address);
        if (!pud)
                goto out;
        pmd = pmd_alloc(mm, pud, address);
        if (!pmd)
                goto out;
-       pte = pte_alloc_map(mm, pmd, address);
+       pte = pte_alloc_map_lock(mm, pmd, address, &ptl);
        if (!pte)
                goto out;
        if (!pte_none(*pte)) {
-               pte_unmap(pte);
+               pte_unmap_unlock(pte, ptl);
                goto out;
        }
-       inc_mm_counter(mm, rss);
+       inc_mm_counter(mm, anon_rss);
        lru_cache_add_active(page);
        set_pte_at(mm, address, pte, pte_mkdirty(pte_mkwrite(mk_pte(
                                        page, vma->vm_page_prot))));
        page_add_anon_rmap(page, vma, address);
-       pte_unmap(pte);
-       spin_unlock(&mm->page_table_lock);
+       pte_unmap_unlock(pte, ptl);
 
        /* no need for flush_tlb */
        return;
 out:
-       spin_unlock(&mm->page_table_lock);
-out_sig:
        __free_page(page);
        force_sig(SIGKILL, current);
 }
@@ -634,10 +630,9 @@ static inline int de_thread(struct task_struct *tsk)
        /*
         * Account for the thread group leader hanging around:
         */
-       count = 2;
-       if (thread_group_leader(current))
-               count = 1;
-       else {
+       count = 1;
+       if (!thread_group_leader(current)) {
+               count = 2;
                /*
                 * The SIGALRM timer survives the exec, but needs to point
                 * at us as the new group leader now.  We have a race with
@@ -646,8 +641,10 @@ static inline int de_thread(struct task_struct *tsk)
                 * before we can safely let the old group leader die.
                 */
                sig->real_timer.data = (unsigned long)current;
+               spin_unlock_irq(lock);
                if (del_timer_sync(&sig->real_timer))
                        add_timer(&sig->real_timer);
+               spin_lock_irq(lock);
        }
        while (atomic_read(&sig->count) > count) {
                sig->group_exit_task = current;
@@ -659,7 +656,6 @@ static inline int de_thread(struct task_struct *tsk)
        }
        sig->group_exit_task = NULL;
        sig->notify_count = 0;
-       sig->real_timer.data = (unsigned long)current;
        spin_unlock_irq(lock);
 
        /*
@@ -1207,7 +1203,6 @@ int do_execve(char * filename,
                /* execve success */
                security_bprm_free(bprm);
                acct_update_integrals(current);
-               update_mem_hiwater(current);
                kfree(bprm);
                return retval;
        }