Oleg Nesterov | 1 Apr 01:00 2010
Picon

Re: [PATCH -mm] proc: don't take ->siglock for /proc/pid/oom_adj

On 03/31, David Rientjes wrote:
>
> On Wed, 31 Mar 2010, Oleg Nesterov wrote:
>
> > David, I just can't understand why
> > 	oom-badness-heuristic-rewrite.patch
> > duplicates the related code in fs/proc/base.c and why it preserves
> > the deprecated signal->oom_adj.
>
> You could combine the two write functions together and then two read
> functions together if you'd like.

Yes,

> > 	static ssize_t oom_any_adj_write(struct file *file, const char __user *buf,
> > 						size_t count, bool deprecated_mode)
> > 	{
> >
> > 		if (depraceted_mode) {
> > 			 if (oom_score_adj == OOM_ADJUST_MAX)
> > 				oom_score_adj = OOM_SCORE_ADJ_MAX;
>
> ???

What?

> > 			 else
> > 				oom_score_adj = (oom_score_adj * OOM_SCORE_ADJ_MAX) /
> > 						-OOM_DISABLE;
> > 		}
(Continue reading)

Oleg Nesterov | 1 Apr 01:30 2010
Picon

Re: [patch] oom: give current access to memory reserves if it has been killed

On 04/01, Oleg Nesterov wrote:
>
> On 03/31, David Rientjes wrote:
> >
> > On Wed, 31 Mar 2010, Oleg Nesterov wrote:
> >
> > > On 03/30, David Rientjes wrote:
> > > >
> > > > On Tue, 30 Mar 2010, Oleg Nesterov wrote:
> > > >
> > > > > Note that __oom_kill_task() does force_sig(SIGKILL) which assumes that
> > > > > ->sighand != NULL. This is not true if out_of_memory() is called after
> > > > > current has already passed exit_notify().
> > > >
> > > > We have an even bigger problem if current is in the oom killer at
> > > > exit_notify() since it has already detached its ->mm in exit_mm() :)
> > >
> > > Can't understand... I thought that in theory even kmalloc(1) can trigger
> > > oom.
> >
> > __oom_kill_task() cannot be called on a task without an ->mm.
>
> Why? You ignored this part:
>
> 	Say, right after exit_mm() we are doing acct_process(), and f_op->write()
> 	needs a page. So, you are saying that in this case __page_cache_alloc()
> 	can never trigger out_of_memory() ?
>
> why this is not possible?
>
(Continue reading)

David Rientjes | 1 Apr 01:48 2010
Picon

Re: [patch] oom: give current access to memory reserves if it has been killed

On Thu, 1 Apr 2010, Oleg Nesterov wrote:

> > Why? You ignored this part:
> >
> > 	Say, right after exit_mm() we are doing acct_process(), and f_op->write()
> > 	needs a page. So, you are saying that in this case __page_cache_alloc()
> > 	can never trigger out_of_memory() ?
> >
> > why this is not possible?
> >
> > David, I am not arguing, I am asking.
> 
> In case I wasn't clear...
> 
> Yes, currently __oom_kill_task(p) is not possible if p->mm == NULL.
> 
> But your patch adds
> 
> 	if (fatal_signal_pending(current))
> 		__oom_kill_task(current);
> 
> into out_of_memory().
> 

Ok, and it's possible during the tasklist scan if current is PF_EXITING 
and that gets passed to oom_kill_process(), so we need the following 
patch.  Can I have your acked-by and then I'll propose it to Andrew with a 
follow-up that merges __oom_kill_task() into oom_kill_task() since it only 
has one caller now anyway?

(Continue reading)

KAMEZAWA Hiroyuki | 1 Apr 01:57 2010

Re: [PATCH 14/14] mm,migration: Allow the migration of PageSwapCache pages

On Wed, 31 Mar 2010 12:27:30 +0100
Mel Gorman <mel <at> csn.ul.ie> wrote:

> On Wed, Mar 31, 2010 at 02:26:23PM +0900, KAMEZAWA Hiroyuki wrote:

> > Then, PageSwapCache is cleared only when swap is freeable even if mapped.
> > 
> > rmap_walk_anon() should be called and the check is not necessary.
> > 
> 
> I follow your reasoning. What caught me is the following comment;
> 
>          * Corner case handling:
>          * 1. When a new swap-cache page is read into, it is added to the LRU
>          * and treated as swapcache but it has no rmap yet.
>          * Calling try_to_unmap() against a page->mapping==NULL page will
>          * trigger a BUG.  So handle it here.
> 
> and the fact that without the check the following bug is triggered;
> 
> [  476.541321] BUG: unable to handle kernel NULL pointer dereference at (null)
> [  476.590328] IP: [<ffffffff81072162>] __bfs+0x1a1/0x1d7
> [  476.590328] PGD 3781c067 PUD 371b2067 PMD 0 
> [  476.590328] Oops: 0000 [#1] PREEMPT SMP 
> [  476.590328] last sysfs file: /sys/block/sr0/capability
> [  476.590328] CPU 0 
> [  476.590328] Modules linked in: highalloc trace_allocmap buddyinfo vmregress_core oprofile
dm_crypt loop i2c_piix4 evdev i2c_core processor serio_raw tpm_tis tpm tpm_bios shpchp pci_hotplug
button ext3 jbd mbcache dm_mirror dm_region_hash dm_log dm_snapshot dm_mod sg sr_mod cdrom sd_mod
ata_generic ahci libahci ide_pci_generic libata ide_core scsi_mod ohci_hcd r8169 mii ehci_hcd floppy
(Continue reading)

KAMEZAWA Hiroyuki | 1 Apr 02:21 2010

Re: [RFC][PATCH] memcg documentation update v2

On Wed, 31 Mar 2010 10:27:26 -0700
Randy Dunlap <randy.dunlap <at> oracle.com> wrote:

> On Wed, 31 Mar 2010 17:51:57 +0900 KAMEZAWA Hiroyuki wrote:
> 
> > Added more changes since v1. 
> > I'm not in hurry, please see when you have free time.
> 
> OK, I have some comments for you to consider.
> 
Thank you!

> 
> > ==
> > Documentation update. We have too much files now....
> > 
> > Changlog:
> >  - added memory.soft_limit_in_bytes to summary.
> >  - rewrite Testing section
> >  - fixed text about page_cgroup allocation
> >  - passed aspell(1) ;)
> >  - rewrote Locking section
> >  - update memory.stat file explanation
> > 
> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu <at> jp.fujitsu.com>
> > ---
> >  Documentation/cgroups/memory.txt |  187 ++++++++++++++++++++++++++++-----------
> >  1 file changed, 139 insertions(+), 48 deletions(-)
> > 
> > Index: mmotm-2.6.34-Mar24/Documentation/cgroups/memory.txt
(Continue reading)

Bob Liu | 1 Apr 03:30 2010
Picon

Re: [PATCH] __isolate_lru_page: skip unneeded mode check

On 3/31/10, KOSAKI Motohiro <kosaki.motohiro <at> jp.fujitsu.com> wrote:
> 2010/3/31 Bob Liu <lliubbo <at> gmail.com>:
>> From: Bob Liu <lliubbo <at> gmail.com>
>>
>> Whether mode is ISOLATE_BOTH or not, we should compare
>> page_is_file_cache with argument file.
>>
>> And there is no more need not when checking the active state.
>>
>> Signed-off-by: Bob Liu <lliubbo <at> gmail.com>
>> ---
>>  mm/vmscan.c |    9 ++-------
>>  1 files changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index e0e5f15..34d7e3d 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>>  <at>  <at>  -862,15 +862,10  <at>  <at>  int __isolate_lru_page(struct page *page, int mode,
>> int file)
>>        if (!PageLRU(page))
>>                return ret;
>>
>> -       /*
>> -        * When checking the active state, we need to be sure we are
>> -        * dealing with comparible boolean values.  Take the logical not
>> -        * of each.
>> -        */
>> -       if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
>> +       if (mode != ISOLATE_BOTH && (PageActive(page) != mode))
(Continue reading)

KOSAKI Motohiro | 1 Apr 03:39 2010

Re: [PATCH] __isolate_lru_page: skip unneeded mode check

> >>  <at>  <at>  -862,15 +862,10  <at>  <at>  int __isolate_lru_page(struct page *page, int mode,
> >> int file)
> >>        if (!PageLRU(page))
> >>                return ret;
> >>
> >> -       /*
> >> -        * When checking the active state, we need to be sure we are
> >> -        * dealing with comparible boolean values.  Take the logical not
> >> -        * of each.
> >> -        */
> >> -       if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
> >> +       if (mode != ISOLATE_BOTH && (PageActive(page) != mode))
> >>                return ret;
> >
> > no. please read the comment.
> >
> 
> Hm,. I have read it, but still miss it :-).
> PageActive(page) will return an int 0 or 1, mode is also int 0 or 1(
> already != ISOLATE_BOTH).
> There are comparible and why must to be sure to boolean values?

hm, ok. you are right.
please resend this part as individual patch.

> >> -       if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
> >> +       if (page_is_file_cache(page) != file)
> >>                return ret;
> >
> > no. please consider lumpy reclaim.
(Continue reading)

Miao Xie | 1 Apr 04:16 2010

Re: [PATCH V2 4/4] cpuset,mm: update task's mems_allowed lazily

on 2010-3-31 18:34, David Rientjes wrote:
> On Wed, 31 Mar 2010, Miao Xie wrote:
> 
>> diff --git a/mm/mmzone.c b/mm/mmzone.c
>> index f5b7d17..43ac21b 100644
>> --- a/mm/mmzone.c
>> +++ b/mm/mmzone.c
>>  <at>  <at>  -58,6 +58,7  <at>  <at>  struct zoneref *next_zones_zonelist(struct zoneref *z,
>>  					nodemask_t *nodes,
>>  					struct zone **zone)
>>  {
>> +	nodemask_t tmp_nodes;
>>  	/*
>>  	 * Find the next suitable zone to use for the allocation.
>>  	 * Only filter based on nodemask if it's set
>>  <at>  <at>  -65,10 +66,16  <at>  <at>  struct zoneref *next_zones_zonelist(struct zoneref *z,
>>  	if (likely(nodes == NULL))
>>  		while (zonelist_zone_idx(z) > highest_zoneidx)
>>  			z++;
>> -	else
>> -		while (zonelist_zone_idx(z) > highest_zoneidx ||
>> -				(z->zone && !zref_in_nodemask(z, nodes)))
>> -			z++;
>> +	else {
>> +		tmp_nodes = *nodes;
>> +		if (nodes_empty(tmp_nodes))
>> +			while (zonelist_zone_idx(z) > highest_zoneidx)
>> +				z++;
>> +		else
>> +			while (zonelist_zone_idx(z) > highest_zoneidx ||
(Continue reading)

Minchan Kim | 1 Apr 04:39 2010
Picon

Re: [PATCH 14/14] mm,migration: Allow the migration of PageSwapCache pages

On Thu, Apr 1, 2010 at 8:57 AM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu <at> jp.fujitsu.com>
>
> rmap_walk_anon() is called against unmapped pages.
> Then, !page_mapped() is always true. So, the behavior will not be different from
> the last one.
>

rmap_walk_anon can be also called in case of failing try_to_unmap.
Then, In unmap_and_move, page_mapped is true and
remove_migration_ptes can be called.

But I am not sure this Mel's patch about this part is really needed.

> Thanks,
> -Kame
>
>

--

-- 
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo <at> kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont <at> kvack.org"> email <at> kvack.org </a>

(Continue reading)

Minchan Kim | 1 Apr 04:43 2010
Picon

Re: [PATCH 14/14] mm,migration: Allow the migration of PageSwapCache pages

On Wed, Mar 31, 2010 at 2:26 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu <at> jp.fujitsu.com> wrote:
> On Tue, 30 Mar 2010 10:14:49 +0100
> Mel Gorman <mel <at> csn.ul.ie> wrote:
>
>> PageAnon pages that are unmapped may or may not have an anon_vma so
>> are not currently migrated. However, a swap cache page can be migrated
>> and fits this description. This patch identifies page swap caches and
>> allows them to be migrated.
>>
>
> Some comments.
>
>> Signed-off-by: Mel Gorman <mel <at> csn.ul.ie>
>> ---
>>  mm/migrate.c |   15 ++++++++++-----
>>  mm/rmap.c    |    6 ++++--
>>  2 files changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/migrate.c b/mm/migrate.c
>> index 35aad2a..f9bf37e 100644
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>>  <at>  <at>  -203,6 +203,9  <at>  <at>  static int migrate_page_move_mapping(struct address_space *mapping,
>>       void **pslot;
>>
>>       if (!mapping) {
>> +             if (PageSwapCache(page))
>> +                     SetPageSwapCache(newpage);
>> +
(Continue reading)


Gmane