From: Michal Hocko <mhocko@kernel.org>
To: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: do not inc NR_PAGETABLE if ptlock_init failed
Date: Mon, 19 Oct 2015 15:20:53 +0200 [thread overview]
Message-ID: <20151019132053.GI11998@dhcp22.suse.cz> (raw)
In-Reply-To: <1445256881-5205-1-git-send-email-vdavydov@virtuozzo.com>
On Mon 19-10-15 15:14:41, Vladimir Davydov wrote:
> If ALLOC_SPLIT_PTLOCKS is defined, ptlock_init may fail, in which case
> we shouldn't increment NR_PAGETABLE.
>
> Since small allocations, such as ptlock, normally do not fail (currently
> they can fail if kmemcg is used though), this patch does not really fix
> anything and should be considered as a code cleanup.
>
> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> include/linux/mm.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 6adf4167d664..30ef3b535444 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1553,8 +1553,10 @@ static inline void pgtable_init(void)
>
> static inline bool pgtable_page_ctor(struct page *page)
> {
> + if (!ptlock_init(page))
> + return false;
> inc_zone_page_state(page, NR_PAGETABLE);
> - return ptlock_init(page);
> + return true;
> }
>
> static inline void pgtable_page_dtor(struct page *page)
> --
> 2.1.4
>
> --
> 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>
--
Michal Hocko
SUSE Labs
--
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>
prev parent reply other threads:[~2015-10-19 13:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-19 12:14 Vladimir Davydov
2015-10-19 12:21 ` Kirill A. Shutemov
2015-10-19 13:20 ` Michal Hocko [this message]
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=20151019132053.GI11998@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=vdavydov@virtuozzo.com \
/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