linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm, memcg: sync allocation and memcg charge gfp flags for THP
Date: Wed, 18 Mar 2015 17:09:00 +0100	[thread overview]
Message-ID: <5509A31C.3070108@suse.cz> (raw)
In-Reply-To: <20150318155905.GO17241@dhcp22.suse.cz>

On 03/18/2015 04:59 PM, Michal Hocko wrote:
> On Wed 18-03-15 16:40:34, Vlastimil Babka wrote:
>> On 03/18/2015 04:02 PM, Michal Hocko wrote:
>>> On Wed 18-03-15 15:34:50, Vlastimil Babka wrote:
>>>> On 03/16/2015 03:08 PM, Michal Hocko wrote:
>>>>> @@ -1080,6 +1080,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
>>>>>   	unsigned long haddr;
>>>>>   	unsigned long mmun_start;	/* For mmu_notifiers */
>>>>>   	unsigned long mmun_end;		/* For mmu_notifiers */
>>>>> +	gfp_t huge_gfp = GFP_TRANSHUGE;	/* for allocation and charge */
>>>>
>>>> This value is actually never used. Is it here because the compiler emits a
>>>> spurious non-initialized value warning otherwise? It should be easy for it
>>>> to prove that setting new_page to something non-null implies initializing
>>>> huge_gfp (in the hunk below), and NULL new_page means it doesn't reach the
>>>> mem_cgroup_try_charge() call?
>>>
>>> No, I haven't tried to workaround the compiler. It just made the code
>>> more obvious to me. I can remove the initialization if you prefer, of
>>> course.
>>
>> Yeah IMHO it would be better to remove it, if possible. Leaving it has the
>> (albeit small) chance that future patch will again use the value in the code
>> before it's determined based on defrag setting.
>
> Wouldn't an uninitialized value be used in such a case?

Yeah, but then you should get a (correct) warning :)

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-03-18 16:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 14:08 Michal Hocko
2015-03-18 14:34 ` Vlastimil Babka
2015-03-18 15:02   ` Michal Hocko
2015-03-18 15:40     ` Vlastimil Babka
2015-03-18 15:59       ` Michal Hocko
2015-03-18 16:09         ` Vlastimil Babka [this message]
2015-03-18 16:14           ` [PATCH -v2] " Michal Hocko
2015-04-03  1:41             ` [patch] mm, memcg: sync allocation and memcg charge gfp flags for thp fix fix David Rientjes
2015-04-03  8:38               ` Vlastimil Babka
2015-04-03 10:50               ` Michal Hocko
2015-04-04  1:34             ` [PATCH -v2] mm, memcg: sync allocation and memcg charge gfp flags for THP David Rientjes
2015-04-07 12:19               ` Michal Hocko

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=5509A31C.3070108@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /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