Re: [PATCH 3/4] munmap: kbuild menu for munmap interface

From: Geunsik Lim
Date: Mon Apr 25 2011 - 20:41:05 EST


On Tue, Apr 26, 2011 at 12:31 AM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> On Mon, 2011-04-25 at 19:44 +0900, Geunsik Lim wrote:
>> From: Geunsik Lim <geunsik.lim@xxxxxxxxxxx>
>>
>> Support kbuild menu to select memory unmap operation size
>> at build time.
>
> The subject and this line are not quite the same. The subject looks like
> it only modifies the kbuild options, not mm/memory.c as well. Please
> fix.
You are right. I will fix it.
>
>>
>> Signed-off-by: Geunsik Lim <geunsik.lim@xxxxxxxxxxx>
>> Acked-by: Hyunjin Choi <hj89.choi@xxxxxxxxxxx>
>> ---
>> Âinit/Kconfig | Â 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> Âmm/memory.c Â| Â 21 +++++++++++-----
>> Â2 files changed, 84 insertions(+), 7 deletions(-)
>>
>
>> --- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -57,6 +57,7 @@
>> Â#include <linux/swapops.h>
>> Â#include <linux/elf.h>
>> Â#include <linux/gfp.h>
>> +#include <linux/munmap_unit_size.h>
>>
>> Â#include <asm/io.h>
>> Â#include <asm/pgalloc.h>
>> @@ -1079,6 +1080,10 @@ static unsigned long unmap_page_range(struct mmu_gather *tlb,
>> Â Â Â Â Â Â Â Â Â Â Â (*zap_work)--;
>> Â Â Â Â Â Â Â Â Â Â Â continue;
>> Â Â Â Â Â Â Â }
>> +#if 0
>> +printk("DEBUG:munmap step2,(%s:%d), unmap range = current(%lu) + \
>> +zap_work(%lu bytes) \n", current->comm, current->pid, addr, *zap_work);
>> +#endif
>
> No #if 0 debug printing in mainline.
Thank you for your advice.
>
>> Â Â Â Â Â Â Â next = zap_pud_range(tlb, vma, pgd, addr, next,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â zap_work, details);
>> Â Â Â } while (pgd++, addr = next, (addr != end && *zap_work > 0));
>> @@ -1088,12 +1093,10 @@ static unsigned long unmap_page_range(struct mmu_gather *tlb,
>> Â Â Â return addr;
>> Â}
>>
>> -#ifdef CONFIG_PREEMPT
>> -# define ZAP_BLOCK_SIZE Â Â Â(8 * PAGE_SIZE)
>> -#else
>> -/* No preempt: go for improved straight-line efficiency */
>> -# define ZAP_BLOCK_SIZE Â Â Â(1024 * PAGE_SIZE)
>> -#endif
>> +/* No preempt: go for improved straight-line efficiency
>> + * on PREEMPT(preemption mode) this is not a critical latency-path.
>> + */
>> +# define ZAP_BLOCK_SIZE Â Â Â Â(munmap_unit_size * PAGE_SIZE)
>>
>> Â/**
>> Â * unmap_vmas - unmap a range of memory covered by a list of vma's
>> @@ -1133,7 +1136,11 @@ unsigned long unmap_vmas(struct mmu_gather **tlbp,
>> Â Â Â spinlock_t *i_mmap_lock = details? details->i_mmap_lock: NULL;
>> Â Â Â int fullmm = (*tlbp)->fullmm;
>> Â Â Â struct mm_struct *mm = vma->vm_mm;
>> -
>> +#if 0
>> +printk("DEBUG:munmap step1,(%s:%d), unit=zap_work(%ld)/ZAP_BLOCK(%ld), \
>> +vma:[%8lu]=%lu-%lu \n", current->comm, current->pid, zap_work, ZAP_BLOCK_SIZE, \
>> +vma->vm_end - vma->vm_start, vma->vm_end, vma->vm_start);
>> +#endif
>
> Get rid of this too.
>
> Either have pr_debug(...) or nothing at all.
In fact, I wondered about this debug messages for just debugging. :)
Yes. I will remove this debug messages because it is not necessary
as you commented.
>
> -- Steve
>
>> Â Â Â mmu_notifier_invalidate_range_start(mm, start_addr, end_addr);
>> Â Â Â for ( ; vma && vma->vm_start < end_addr; vma = vma->vm_next) {
>> Â Â Â Â Â Â Â unsigned long end;
>
>
>



--
Regards,
Geunsik Lim ( Samsung Electronics )
Blog : http://blog.naver.com/invain/
e-Mail: geunsik.lim@xxxxxxxxxxx
    Â leemgs@xxxxxxxxx , leemgs1@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/