[PATCH] Frontswap: fix the condition in BUG_ON

2014-10-31 Thread Li Haifeng
>From 012a564c7210346b99d12e3d2485542bb090586e Mon Sep 17 00:00:00 2001 From: Haifeng Li Date: Fri, 31 Oct 2014 17:40:44 +0800 Subject: [PATCH] Frontswap: fix the condition in BUG_ON The largest index of swap device is MAX_SWAPFILES-1. So the type should be less than MAX_SWAPFILES.

[PATCH] Frontswap: fix the condition in BUG_ON

2014-10-31 Thread Li Haifeng
From 012a564c7210346b99d12e3d2485542bb090586e Mon Sep 17 00:00:00 2001 From: Haifeng Li omy...@gmail.com Date: Fri, 31 Oct 2014 17:40:44 +0800 Subject: [PATCH] Frontswap: fix the condition in BUG_ON The largest index of swap device is MAX_SWAPFILES-1. So the type should be less than

Re: Kexec couldn't reboot capture kernel on pandaboard ES with OMAP4460

2013-04-10 Thread Li Haifeng
2013/4/10 Stephen Warren : > On 04/10/2013 03:35 AM, Li Haifeng wrote: >> Hi, everyone. >> >> Recently, I try to run kdump on pandaboard ES with omap4460. After >> load capture kernel by "kexec -l" and execute "kexec -e", the serial >> port ou

Re: Kexec couldn't reboot capture kernel on pandaboard ES with OMAP4460

2013-04-10 Thread Li Haifeng
2013/4/10 Stephen Warren swar...@wwwdotorg.org: On 04/10/2013 03:35 AM, Li Haifeng wrote: Hi, everyone. Recently, I try to run kdump on pandaboard ES with omap4460. After load capture kernel by kexec -l and execute kexec -e, the serial port output Starting new kernel and Bye, then the system

Re: Should a swapped out page be deleted from swap cache?

2013-03-05 Thread Li Haifeng
2013/2/20 Ric Mason : > > Hi Hugh, > > > On 02/20/2013 02:56 AM, Hugh Dickins wrote: >> >> On Tue, 19 Feb 2013, Ric Mason wrote: >>> >>> There is a call of try_to_free_swap in function swap_writepage, if >>> swap_writepage is call from shrink_page_list path, PageSwapCache(page) == >>> trure,

Re: Should a swapped out page be deleted from swap cache?

2013-03-05 Thread Li Haifeng
2013/2/20 Ric Mason ric.mas...@gmail.com: Hi Hugh, On 02/20/2013 02:56 AM, Hugh Dickins wrote: On Tue, 19 Feb 2013, Ric Mason wrote: There is a call of try_to_free_swap in function swap_writepage, if swap_writepage is call from shrink_page_list path, PageSwapCache(page) == trure,

Re: [PATCH] mm: Fixup the condition whether the page cache is free

2013-03-04 Thread Li Haifeng
Thanks very much for you explanation. :-) 2013/3/4 Johannes Weiner : > On Mon, Mar 04, 2013 at 09:54:26AM +0800, Li Haifeng wrote: >> When a page cache is to reclaim, we should to decide whether the page >> cache is free. >> IMO, the condition whether a page cache is fre

Re: [PATCH] mm: Fixup the condition whether the page cache is free

2013-03-04 Thread Li Haifeng
Thanks very much for you explanation. :-) 2013/3/4 Johannes Weiner han...@cmpxchg.org: On Mon, Mar 04, 2013 at 09:54:26AM +0800, Li Haifeng wrote: When a page cache is to reclaim, we should to decide whether the page cache is free. IMO, the condition whether a page cache is free should be 3

[PATCH] mm: Fixup the condition whether the page cache is free

2013-03-03 Thread Li Haifeng
When a page cache is to reclaim, we should to decide whether the page cache is free. IMO, the condition whether a page cache is free should be 3 in page frame reclaiming. The reason lists as below. When page is allocated, the page->_count is 1(code fragment is code-1 ). And when the page is

[PATCH] mm: Fixup the condition whether the page cache is free

2013-03-03 Thread Li Haifeng
When a page cache is to reclaim, we should to decide whether the page cache is free. IMO, the condition whether a page cache is free should be 3 in page frame reclaiming. The reason lists as below. When page is allocated, the page-_count is 1(code fragment is code-1 ). And when the page is

Re: A noobish question on mm

2013-02-19 Thread Li Haifeng
2013/2/19 Soham Chakraborty : > > > On Tue, Feb 19, 2013 at 12:08 PM, Li Haifeng wrote: >> >> 2013/2/19 Soham Chakraborty : >> > Hey dude, >> > >> > Apologies for this kind of approach but I was not sure whether I can >> > directly mail

Re: A noobish question on mm

2013-02-19 Thread Li Haifeng
2013/2/19 Soham Chakraborty sohamwonderpik...@gmail.com: On Tue, Feb 19, 2013 at 12:08 PM, Li Haifeng omy...@gmail.com wrote: 2013/2/19 Soham Chakraborty sohamwonderpik...@gmail.com: Hey dude, Apologies for this kind of approach but I was not sure whether I can directly mail the list

Re: Should a swapped out page be deleted from swap cache?

2013-02-18 Thread Li Haifeng
2013/2/19 Will Huck : > On 02/19/2013 10:04 AM, Li Haifeng wrote: >> >> 2013/2/19 Hugh Dickins >>> >>> On Mon, 18 Feb 2013, Li Haifeng wrote: >>> >>>> For explain my question, the two points should be displayed as below. >>>> >&

Re: A noobish question on mm

2013-02-18 Thread Li Haifeng
2013/2/19 Soham Chakraborty : > Hey dude, > > Apologies for this kind of approach but I was not sure whether I can > directly mail the list with such a noobish question. I have been poking > around in mm subsystem for around 2 years now and I have never got a fine, > bullet proof answer to this

Re: Should a swapped out page be deleted from swap cache?

2013-02-18 Thread Li Haifeng
2013/2/19 Hugh Dickins > > On Mon, 18 Feb 2013, Li Haifeng wrote: > > > For explain my question, the two points should be displayed as below. > > > > 1. If an anonymous page is swapped out, this page will be deleted > > from swap cache and be put back into buddy

Re: Should a swapped out page be deleted from swap cache?

2013-02-18 Thread Li Haifeng
2013/2/19 Hugh Dickins hu...@google.com On Mon, 18 Feb 2013, Li Haifeng wrote: For explain my question, the two points should be displayed as below. 1. If an anonymous page is swapped out, this page will be deleted from swap cache and be put back into buddy system. Yes, unless

Re: A noobish question on mm

2013-02-18 Thread Li Haifeng
2013/2/19 Soham Chakraborty sohamwonderpik...@gmail.com: Hey dude, Apologies for this kind of approach but I was not sure whether I can directly mail the list with such a noobish question. I have been poking around in mm subsystem for around 2 years now and I have never got a fine, bullet

Re: Should a swapped out page be deleted from swap cache?

2013-02-18 Thread Li Haifeng
2013/2/19 Will Huck will.hu...@gmail.com: On 02/19/2013 10:04 AM, Li Haifeng wrote: 2013/2/19 Hugh Dickins hu...@google.com On Mon, 18 Feb 2013, Li Haifeng wrote: For explain my question, the two points should be displayed as below. 1. If an anonymous page is swapped out, this page

Qestion about page->_count and page reclaim

2013-02-05 Thread Li Haifeng
Hi, all in kernel. The page->_count is the page frame's usage count. When page is allocated, the page->_cout will be set 1. After be allocated from buddy system, the page will be used by process. get_page and put_page/put_page_testzero will used in pairs. is it right? When the page is

Qestion about page-_count and page reclaim

2013-02-05 Thread Li Haifeng
Hi, all in kernel. The page-_count is the page frame's usage count. When page is allocated, the page-_cout will be set 1. After be allocated from buddy system, the page will be used by process. get_page and put_page/put_page_testzero will used in pairs. is it right? When the page is reclaimed

[PATCH 2/2] mm: Fixup abandoned PG_buddy for private in struct page

2012-09-06 Thread Li Haifeng
PG_buddy, an abandoned flag, indicates page(s) is/are free and in buddy allocator. And when page(s) in buddy allocator, the _mapcount will equal PAGE_BUDDY_MAPCOUNT_VALUE. So, here, "_mapcount equals PAGE_BUDDY_MAPCOUNT_VALUE" instead of "PG_buddy is set". Signed-off-by: Haifeng Li ---

[PATCH 1/2] mm: Fixup obsolete PG_buddy flag in error_states[]

2012-09-06 Thread Li Haifeng
PG_buddy, an abandoned flag, indicates page(s) is/are free and in buddy allocator. So in the comment, "pages in buddy system" instead of "PG_buddy pages". Signed-off-by: Haifeng Li --- mm/memory-failure.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git

[PATCH 1/2] mm: Fixup obsolete PG_buddy flag in error_states[]

2012-09-06 Thread Li Haifeng
PG_buddy, an abandoned flag, indicates page(s) is/are free and in buddy allocator. So in the comment, pages in buddy system instead of PG_buddy pages. Signed-off-by: Haifeng Li omy...@gmail.com --- mm/memory-failure.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git

[PATCH 2/2] mm: Fixup abandoned PG_buddy for private in struct page

2012-09-06 Thread Li Haifeng
PG_buddy, an abandoned flag, indicates page(s) is/are free and in buddy allocator. And when page(s) in buddy allocator, the _mapcount will equal PAGE_BUDDY_MAPCOUNT_VALUE. So, here, _mapcount equals PAGE_BUDDY_MAPCOUNT_VALUE instead of PG_buddy is set. Signed-off-by: Haifeng Li omy...@gmail.com

Re: Fixup the page of buddy_higher address's calculation

2012-08-24 Thread Li Haifeng
2012/8/24 Michal Hocko : > On Fri 24-08-12 10:08:20, Li Haifeng wrote: > [...] >> Subject: [PATCH] Fix the page address of higher page's buddy calculation >> >> Calculate the page address of higher page's buddy should be based >> higher_page with the offse

Re: Fixup the page of buddy_higher address's calculation

2012-08-24 Thread Li Haifeng
2012/8/24 Michal Hocko mho...@suse.cz: On Fri 24-08-12 10:08:20, Li Haifeng wrote: [...] Subject: [PATCH] Fix the page address of higher page's buddy calculation Calculate the page address of higher page's buddy should be based higher_page with the offset between index of higher page

Re: Fixup the page of buddy_higher address's calculation

2012-08-23 Thread Li Haifeng
2012/8/23 Michal Hocko : > On Thu 23-08-12 20:30:34, Gavin Shan wrote: >> On Thu, Aug 23, 2012 at 06:21:06PM +0800, Li Haifeng wrote: > [...] >> >>> From d7cd78f9d71a5c9ddeed02724558096f0bb4508a Mon Sep 17 00:00:00 2001 >> >>> From: Haifeng Li &g

Re: Fixup the page of buddy_higher address's calculation

2012-08-23 Thread Li Haifeng
+ (buddy_idx - page_idx)). Maybe, a diagram is easier to understand. |-|-| page combined buddy buddy's page address= page‘s page address + (buddy - page)*sizeof(struct page) Clear? 2012/8/23 Michal Hocko : > On Thu 23-08-12 16:40:13, Li Haif

Re: Fixup the page of buddy_higher address's calculation

2012-08-23 Thread Li Haifeng
, Li Haifeng wrote: From d7cd78f9d71a5c9ddeed02724558096f0bb4508a Mon Sep 17 00:00:00 2001 From: Haifeng Li omy...@gmail.com Date: Thu, 23 Aug 2012 16:27:19 +0800 Subject: [PATCH] Fixup the page of buddy_higher address's calculation Some general questions: Any word about the change? Is it really

Re: Fixup the page of buddy_higher address's calculation

2012-08-23 Thread Li Haifeng
2012/8/23 Michal Hocko mho...@suse.cz: On Thu 23-08-12 20:30:34, Gavin Shan wrote: On Thu, Aug 23, 2012 at 06:21:06PM +0800, Li Haifeng wrote: [...] From d7cd78f9d71a5c9ddeed02724558096f0bb4508a Mon Sep 17 00:00:00 2001 From: Haifeng Li omy...@gmail.com Date: Thu, 23 Aug 2012 16:27:19

Re: ARM: why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions

2012-07-13 Thread Li Haifeng
Hi Shan, 2012/7/12 shan kang : > Hello, >I wonder why smp_mb() is not needed in the "__mutex_fastpath_lock" > and "__mutex_fastpath_unlock" functions which are located in the > "arch/arm/include/asm/mutex.h"? >I think "dmb" instruction is necessary there. Why necessary? Could you explain

Re: ARM: why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions

2012-07-13 Thread Li Haifeng
Hi Shan, 2012/7/12 shan kang kangshan0...@gmail.com: Hello, I wonder why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions which are located in the arch/arm/include/asm/mutex.h? I think dmb instruction is necessary there. Why necessary? Could