* [PATCH] xvmalloc: total_pages can be ulong
@ 2011-12-28 5:50 Ajeet Yadav
2011-12-29 13:58 ` Nitin Gupta
2012-02-09 1:11 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Ajeet Yadav @ 2011-12-28 5:50 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-kernel, Nitin Gupta
>From 4763266cb0077d1082d4a1ef941448e9b4eb55ca Mon Sep 17 00:00:00 2001
From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
Date: Wed, 28 Dec 2011 11:08:34 +0530
Subject: [PATCH] xvmalloc: total_pages can be ulong
total_pages is u64, its too large value considering
that its in page unit on both 32-bit and 64-bit system
, therefore make it ulong.
Having done that we can use normal ++ and -- operators
instead of stat_inc() and stat_dec(), therefore
remove these functions as well.
Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
---
drivers/staging/zram/xvmalloc.c | 16 +++-------------
drivers/staging/zram/xvmalloc_int.h | 2 +-
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/zram/xvmalloc.c b/drivers/staging/zram/xvmalloc.c
index 1f9c508..2f989cf 100644
--- a/drivers/staging/zram/xvmalloc.c
+++ b/drivers/staging/zram/xvmalloc.c
@@ -26,16 +26,6 @@
#include "xvmalloc.h"
#include "xvmalloc_int.h"
-static void stat_inc(u64 *value)
-{
- *value = *value + 1;
-}
-
-static void stat_dec(u64 *value)
-{
- *value = *value - 1;
-}
-
static int test_flag(struct block_header *block, enum blockflags flag)
{
return block->prev & BIT(flag);
@@ -281,7 +271,7 @@ static int grow_pool(struct xv_pool *pool, gfp_t flags)
if (unlikely(!page))
return -ENOMEM;
- stat_inc(&pool->total_pages);
+ pool->total_pages++;
spin_lock(&pool->lock);
block = get_ptr_atomic(page, 0, KM_USER0);
@@ -472,7 +462,7 @@ void xv_free(struct xv_pool *pool, struct page
*page, u32 offset)
spin_unlock(&pool->lock);
__free_page(page);
- stat_dec(&pool->total_pages);
+ pool->total_pages--;
return;
}
@@ -505,6 +495,6 @@ EXPORT_SYMBOL_GPL(xv_get_object_size);
*/
u64 xv_get_total_size_bytes(struct xv_pool *pool)
{
- return pool->total_pages << PAGE_SHIFT;
+ return (u64)pool->total_pages << PAGE_SHIFT;
}
EXPORT_SYMBOL_GPL(xv_get_total_size_bytes);
diff --git a/drivers/staging/zram/xvmalloc_int.h
b/drivers/staging/zram/xvmalloc_int.h
index b5f1f7f..fcb0868 100644
--- a/drivers/staging/zram/xvmalloc_int.h
+++ b/drivers/staging/zram/xvmalloc_int.h
@@ -87,7 +87,7 @@ struct block_header {
struct xv_pool {
ulong flbitmap;
ulong slbitmap[MAX_FLI];
- u64 total_pages; /* stats */
+ ulong total_pages; /* stats */
struct freelist_entry freelist[NUM_FREE_LISTS];
spinlock_t lock;
};
--
1.6.0.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] xvmalloc: total_pages can be ulong
2011-12-28 5:50 [PATCH] xvmalloc: total_pages can be ulong Ajeet Yadav
@ 2011-12-29 13:58 ` Nitin Gupta
2011-12-30 4:51 ` Ajeet Yadav
2012-02-09 1:11 ` Greg KH
1 sibling, 1 reply; 7+ messages in thread
From: Nitin Gupta @ 2011-12-29 13:58 UTC (permalink / raw)
To: Ajeet Yadav; +Cc: Greg Kroah-Hartman, linux-kernel
Hi Ajeet,
On 12/28/2011 12:50 AM, Ajeet Yadav wrote:
> From 4763266cb0077d1082d4a1ef941448e9b4eb55ca Mon Sep 17 00:00:00 2001
> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> Date: Wed, 28 Dec 2011 11:08:34 +0530
> Subject: [PATCH] xvmalloc: total_pages can be ulong
>
> total_pages is u64, its too large value considering
> that its in page unit on both 32-bit and 64-bit system
> , therefore make it ulong.
>
> Having done that we can use normal ++ and -- operators
> instead of stat_inc() and stat_dec(), therefore
> remove these functions as well.
>
I'm soon going to send patches which replace xvmalloc with a new allocator.
Thanks,
Nitin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xvmalloc: total_pages can be ulong
2011-12-29 13:58 ` Nitin Gupta
@ 2011-12-30 4:51 ` Ajeet Yadav
0 siblings, 0 replies; 7+ messages in thread
From: Ajeet Yadav @ 2011-12-30 4:51 UTC (permalink / raw)
To: Nitin Gupta; +Cc: Greg Kroah-Hartman, linux-kernel
Hi Nitin,
I wish if I could somehow know your plans for next release, so that I
can schedule my work accordingly, else my work on zram will be total
waste of my time making patches and your time replying and reviewing
it. Finally I have decided to delete my zram git.
Thanks and wishes for new year in advance.
On Thu, Dec 29, 2011 at 7:28 PM, Nitin Gupta <ngupta@vflare.org> wrote:
> Hi Ajeet,
>
> On 12/28/2011 12:50 AM, Ajeet Yadav wrote:
>
>> From 4763266cb0077d1082d4a1ef941448e9b4eb55ca Mon Sep 17 00:00:00 2001
>> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
>> Date: Wed, 28 Dec 2011 11:08:34 +0530
>> Subject: [PATCH] xvmalloc: total_pages can be ulong
>>
>> total_pages is u64, its too large value considering
>> that its in page unit on both 32-bit and 64-bit system
>> , therefore make it ulong.
>>
>> Having done that we can use normal ++ and -- operators
>> instead of stat_inc() and stat_dec(), therefore
>> remove these functions as well.
>>
>
>
> I'm soon going to send patches which replace xvmalloc with a new allocator.
>
> Thanks,
> Nitin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xvmalloc: total_pages can be ulong
2011-12-28 5:50 [PATCH] xvmalloc: total_pages can be ulong Ajeet Yadav
2011-12-29 13:58 ` Nitin Gupta
@ 2012-02-09 1:11 ` Greg KH
2012-02-10 10:21 ` Ajeet Yadav
2012-02-10 13:58 ` Nitin Gupta
1 sibling, 2 replies; 7+ messages in thread
From: Greg KH @ 2012-02-09 1:11 UTC (permalink / raw)
To: Ajeet Yadav; +Cc: Greg Kroah-Hartman, linux-kernel, Nitin Gupta
On Wed, Dec 28, 2011 at 11:20:51AM +0530, Ajeet Yadav wrote:
> >From 4763266cb0077d1082d4a1ef941448e9b4eb55ca Mon Sep 17 00:00:00 2001
> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
> Date: Wed, 28 Dec 2011 11:08:34 +0530
> Subject: [PATCH] xvmalloc: total_pages can be ulong
>
> total_pages is u64, its too large value considering
> that its in page unit on both 32-bit and 64-bit system
> , therefore make it ulong.
Your patch is line-wrapped and can not be applied.
Please use the git send-email command to send the patch, otherwise bad
things like this can happen :(
Care to redo it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xvmalloc: total_pages can be ulong
2012-02-09 1:11 ` Greg KH
@ 2012-02-10 10:21 ` Ajeet Yadav
2012-02-10 13:58 ` Nitin Gupta
1 sibling, 0 replies; 7+ messages in thread
From: Ajeet Yadav @ 2012-02-10 10:21 UTC (permalink / raw)
To: Greg KH; +Cc: Greg Kroah-Hartman, linux-kernel, Nitin Gupta
sure, thanks for feedback
On Thu, Feb 9, 2012 at 6:41 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Dec 28, 2011 at 11:20:51AM +0530, Ajeet Yadav wrote:
>> >From 4763266cb0077d1082d4a1ef941448e9b4eb55ca Mon Sep 17 00:00:00 2001
>> From: Ajeet Yadav <ajeet.yadav.77@gmail.com>
>> Date: Wed, 28 Dec 2011 11:08:34 +0530
>> Subject: [PATCH] xvmalloc: total_pages can be ulong
>>
>> total_pages is u64, its too large value considering
>> that its in page unit on both 32-bit and 64-bit system
>> , therefore make it ulong.
>
> Your patch is line-wrapped and can not be applied.
>
> Please use the git send-email command to send the patch, otherwise bad
> things like this can happen :(
>
> Care to redo it?
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xvmalloc: total_pages can be ulong
2012-02-09 1:11 ` Greg KH
2012-02-10 10:21 ` Ajeet Yadav
@ 2012-02-10 13:58 ` Nitin Gupta
2012-02-11 6:43 ` Ajeet Yadav
1 sibling, 1 reply; 7+ messages in thread
From: Nitin Gupta @ 2012-02-10 13:58 UTC (permalink / raw)
To: Greg KH; +Cc: Ajeet Yadav, Greg Kroah-Hartman, linux-kernel
On 2/8/12 8:11 PM, Greg KH wrote:
> On Wed, Dec 28, 2011 at 11:20:51AM +0530, Ajeet Yadav wrote:
>> > From 4763266cb0077d1082d4a1ef941448e9b4eb55ca Mon Sep 17 00:00:00 2001
>> From: Ajeet Yadav<ajeet.yadav.77@gmail.com>
>> Date: Wed, 28 Dec 2011 11:08:34 +0530
>> Subject: [PATCH] xvmalloc: total_pages can be ulong
>>
>> total_pages is u64, its too large value considering
>> that its in page unit on both 32-bit and 64-bit system
>> , therefore make it ulong.
>
> Your patch is line-wrapped and can not be applied.
>
> Please use the git send-email command to send the patch, otherwise bad
> things like this can happen :(
>
> Care to redo it?
>
Since xvmalloc has now been replaced with zsmalloc, this patch is no
longer required.
Thanks,
Nitin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xvmalloc: total_pages can be ulong
2012-02-10 13:58 ` Nitin Gupta
@ 2012-02-11 6:43 ` Ajeet Yadav
0 siblings, 0 replies; 7+ messages in thread
From: Ajeet Yadav @ 2012-02-11 6:43 UTC (permalink / raw)
To: Nitin Gupta; +Cc: Greg KH, Greg Kroah-Hartman, linux-kernel
thanks
On Fri, Feb 10, 2012 at 7:28 PM, Nitin Gupta <ngupta@vflare.org> wrote:
> On 2/8/12 8:11 PM, Greg KH wrote:
>>
>> On Wed, Dec 28, 2011 at 11:20:51AM +0530, Ajeet Yadav wrote:
>>>
>>> > From 4763266cb0077d1082d4a1ef941448e9b4eb55ca Mon Sep 17 00:00:00 2001
>>> From: Ajeet Yadav<ajeet.yadav.77@gmail.com>
>>> Date: Wed, 28 Dec 2011 11:08:34 +0530
>>> Subject: [PATCH] xvmalloc: total_pages can be ulong
>>>
>>> total_pages is u64, its too large value considering
>>> that its in page unit on both 32-bit and 64-bit system
>>> , therefore make it ulong.
>>
>>
>> Your patch is line-wrapped and can not be applied.
>>
>> Please use the git send-email command to send the patch, otherwise bad
>> things like this can happen :(
>>
>> Care to redo it?
>>
>
> Since xvmalloc has now been replaced with zsmalloc, this patch is no longer
> required.
>
> Thanks,
> Nitin
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-11 6:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-28 5:50 [PATCH] xvmalloc: total_pages can be ulong Ajeet Yadav
2011-12-29 13:58 ` Nitin Gupta
2011-12-30 4:51 ` Ajeet Yadav
2012-02-09 1:11 ` Greg KH
2012-02-10 10:21 ` Ajeet Yadav
2012-02-10 13:58 ` Nitin Gupta
2012-02-11 6:43 ` Ajeet Yadav
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).