linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bob Liu <lliubbo@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Michal Hocko <mhocko@suse.cz>,
	Johannes Weiner <hannes@cmpxchg.org>,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	kamezawa.hiroyu@jp.fujitsu.com, cesarb@cesarb.net,
	emunson@mgebm.net, penberg@kernel.org, namhyung@gmail.com,
	lucas.demarchi@profusion.mobi, aarcange@redhat.com,
	tj@kernel.org, vapier@gentoo.org, jkosina@suse.cz,
	rientjes@google.com
Subject: Re: [PATCH 2/4] frontswap: using vzalloc instead of vmalloc
Date: Sat, 6 Aug 2011 11:59:51 +0800	[thread overview]
Message-ID: <CAA_GA1eN16oo2G3vuYfjF_nL6+tuOO5AZmV0zBQSiT7Fdk5ftQ@mail.gmail.com> (raw)
In-Reply-To: <2d2a3645-83e4-4701-b49a-92b3cbe57880@default>

On Sat, Aug 6, 2011 at 2:13 AM, Dan Magenheimer
<dan.magenheimer@oracle.com> wrote:
>> From: Bob Liu [mailto:lliubbo@gmail.com]
>> Subject: Re: [PATCH 2/4] frontswap: using vzalloc instead of vmalloc
>>
>> On Fri, Aug 5, 2011 at 10:45 AM, Dan Magenheimer
>> <dan.magenheimer@oracle.com> wrote:
>> >> > I am fairly sure that the failed allocation is handled gracefully
>> >> > through the remainder of the frontswap code, but will re-audit to
>> >> > confirm.  A warning might be nice though.
>> >>
>> >> There is a place i think maybe have problem.
>> >> function __frontswap_flush_area() in file frontswap.c called
>> >> memset(sis->frontswap_map, .., ..);
>> >> But if frontswap_map allocation fail there is a null pointer access ?
>> >
>> > Good catch!
>> >
>> > I'll fix that when I submit a frontswap update in a few days.
>>
>> Would you please add current patch to you frontswap update series ?
>> So I needn't to send a Version 2 separately with only drop the
>> allocation failed handler.
>> Thanks.
>> Regards,
>> --Bob
>
> Hi Bob --
>
> I'm not an expert here, so you or others can feel free to correct me if I've
> got this wrong or if I misunderstood you, but I don't think that's the way
> patchsets are supposed to be done, at least until they are merged into Linus'
> tree.  I think you are asking me to add a fifth patch in the frontswap
> patch series that fixes this bug, rather than incorporate the fix into
> the next posted version of the frontswap patchset.  However, I expect
> to post V5 soon with some additional (minor syntactic) changes to the
> patchset from Konrad Wilk's very thorough review.  Then this V5 will
> replace the current version in linux-next soon thereafter (and hopefully
> then into linux-3.2.)  So I think it would be the correct process for me
> to include your bugfix (with an acknowledgement in the commit log) in
> that posted V5.
>

Yes, but current patch "frontswap: using vzalloc instead of vmalloc"
has the error handler
which is unneeded.
+               if (!frontswap_map)
+                       goto bad_swap;

If you want to include it into your series you must delete it by
yourself(or I send an new one) and then add an
extra patch which fix the frontswap_map null pointer bug into your series too.

That's what I want. Sorry for the noise :).

> That said, if you are using frontswap V4 (the version currently in
> linux-next), the bug fix we've discussed needs to be fixed but is
> exceedingly unlikely to occur in the real world because it would
> require the malloc of swap_map to succeed (which is 8 bits per swap page
> in the swapon'ed swap device) but the malloc of frontswap_map immediately
> thereafter to fail (which is 1 bit per swap page in the swapon'ed swap
> device).  (And also this is not a problem for the vast majority of
> kernel developers... it's only possible for frontswap users like you that
> have enabled zcache or tmem or RAMster via a kernel boot option.)
>
> Thanks,
> Dan
>

-- 
Regards,
--Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-08-06  3:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04  3:09 [PATCH 1/4] page cgroup: " Bob Liu
2011-08-04  3:09 ` [PATCH 2/4] frontswap: " Bob Liu
2011-08-04  3:09   ` [PATCH 3/4] sparse: using kzalloc to clean up code Bob Liu
2011-08-04  3:09     ` [PATCH 4/4] percpu: rename pcpu_mem_alloc to pcpu_mem_zalloc Bob Liu
2011-08-04  6:13       ` Pekka Enberg
2011-08-04  8:09       ` Michal Hocko
2011-08-04  9:04       ` Tejun Heo
2011-08-04  6:10     ` [PATCH 3/4] sparse: using kzalloc to clean up code Pekka Enberg
2011-08-04  6:55       ` Bob Liu
2011-08-04  7:22         ` Johannes Weiner
2011-08-04  7:26     ` Johannes Weiner
2011-08-04  7:37       ` Pekka Enberg
2011-08-04  8:07     ` Michal Hocko
2011-08-04  7:57   ` [PATCH 2/4] frontswap: using vzalloc instead of vmalloc Michal Hocko
2011-08-04  8:14     ` Johannes Weiner
2011-08-04  9:00       ` Michal Hocko
2011-08-04 16:47         ` Dan Magenheimer
2011-08-05  2:36           ` Bob Liu
2011-08-05  2:45             ` Dan Magenheimer
2011-08-05  2:57               ` Bob Liu
2011-08-05 18:13                 ` Dan Magenheimer
2011-08-06  3:59                   ` Bob Liu [this message]
2011-08-04  6:02 ` [PATCH 1/4] page cgroup: " Pekka Enberg
2011-08-04  7:23 ` Johannes Weiner
2011-08-04  7:53 ` Michal Hocko
2011-08-08  0:56 ` KAMEZAWA Hiroyuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA_GA1eN16oo2G3vuYfjF_nL6+tuOO5AZmV0zBQSiT7Fdk5ftQ@mail.gmail.com \
    --to=lliubbo@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=cesarb@cesarb.net \
    --cc=dan.magenheimer@oracle.com \
    --cc=emunson@mgebm.net \
    --cc=hannes@cmpxchg.org \
    --cc=jkosina@suse.cz \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=mhocko@suse.cz \
    --cc=namhyung@gmail.com \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=tj@kernel.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox