lkml.org 
[lkml]   [2012]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: echo 1 > /proc/sys/vm/compact_memory -> sh: write error: Bad address
Date
>-----Original Message-----
>From: David Rientjes [mailto:rientjes@google.com]
>Sent: Friday, December 28, 2012 6:39 AM
>To: Liu Hui-R64343
>Cc: Mel Gorman; linux-kernel@vger.kernel.org
>Subject: Re: echo 1 > /proc/sys/vm/compact_memory -> sh: write error: Bad
>address
>
>On Thu, 27 Dec 2012, Liu Hui-R64343 wrote:
>
>> diff --git a/mm/compaction.c b/mm/compaction.c index c4bc5ac..d3cb27f
>> 100644
>> --- a/mm/compaction.c
>> +++ b/mm/compaction.c
>> @@ -732,8 +732,10 @@ int sysctl_compact_memory; int
>> sysctl_compaction_handler(struct ctl_table *table, int write,
>> void __user *buffer, size_t *length, loff_t
>> *ppos) {
>> - if (write)
>> - return compact_nodes();
>> + if (write) {
>> + compact_nodes();
>> + return *length;
>> + }
>>
>> return 0;
>> }
>
>No need to return the length at all, simply change compact_nodes() to return
>void, remove the return value, and do
>
> if (write)
> compact_nodes();
> return 0;
>
>and it should be fixed.

Yes, this works. Thanks,

> Could you write a changelog that shows the before
>and after behavior (not necessarily the implementation), sign-off the patch
>as described in Documentation/SubmittingPatches, running
>scripts/get_maintainer.pl on your new patch file, and sending it to all
>addresses that are listed?

OK, I will send out the patch as you suggested.

Happy holiday.

Jason Liu



\
 
 \ /
  Last update: 2012-12-28 07:41    [W:0.053 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site