Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14974
b: refs/heads/master
c: fb155c1
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Dec 12, 2005
1 parent 61708c6 commit a5ea475
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 927fe18397b3b1194a5b26b1d388d97e391e5fd2
refs/heads/master: fb155c1619f056ae9765eed272cd6aba6e1a7399
20 changes: 5 additions & 15 deletions trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,19 +274,18 @@ static void acpi_processor_idle(void)
}
}

cx->usage++;

#ifdef CONFIG_HOTPLUG_CPU
/*
* Check for P_LVL2_UP flag before entering C2 and above on
* an SMP system. We do it here instead of doing it at _CST/P_LVL
* detection phase, to work cleanly with logical CPU hotplug.
*/
if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
!pr->flags.has_cst && !acpi_fadt.plvl2_up)
cx = &pr->power.states[ACPI_STATE_C1];
!pr->flags.has_cst && acpi_fadt.plvl2_up)
cx->type = ACPI_STATE_C1;
#endif

cx->usage++;

/*
* Sleep:
* ------
Expand Down Expand Up @@ -387,15 +386,6 @@ static void acpi_processor_idle(void)

next_state = pr->power.state;

#ifdef CONFIG_HOTPLUG_CPU
/* Don't do promotion/demotion */
if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) &&
!pr->flags.has_cst && !acpi_fadt.plvl2_up) {
next_state = cx;
goto end;
}
#endif

/*
* Promotion?
* ----------
Expand Down Expand Up @@ -567,7 +557,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
* Check for P_LVL2_UP flag before entering C2 and above on
* an SMP system.
*/
if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up)
return_VALUE(-ENODEV);
#endif

Expand Down
16 changes: 12 additions & 4 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;
if (pfn == vma->vm_pgoff + off)
return NULL;
if (vma->vm_flags & VM_SHARED)
return NULL;
}

/*
Expand Down Expand Up @@ -1343,9 +1345,6 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
struct mm_struct *mm = vma->vm_mm;
int err;

if (addr != vma->vm_start || end != vma->vm_end)
return incomplete_pfn_remap(vma, addr, end, pfn, prot);

/*
* Physically remapped pages are special. Tell the
* rest of the world about it:
Expand All @@ -1359,9 +1358,18 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
* VM_PFNMAP tells the core MM that the base pages are just
* raw PFN mappings, and do not have a "struct page" associated
* with them.
*
* There's a horrible special case to handle copy-on-write
* behaviour that some programs depend on. We mark the "original"
* un-COW'ed pages by matching them up with "vma->vm_pgoff".
*/
if (!(vma->vm_flags & VM_SHARED)) {
if (addr != vma->vm_start || end != vma->vm_end)
return incomplete_pfn_remap(vma, addr, end, pfn, prot);
vma->vm_pgoff = pfn;
}

vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
vma->vm_pgoff = pfn;

BUG_ON(addr >= end);
pfn -= addr >> PAGE_SHIFT;
Expand Down

0 comments on commit a5ea475

Please sign in to comment.