From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753958AbbJSNU5 (ORCPT ); Mon, 19 Oct 2015 09:20:57 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:33794 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753811AbbJSNUz (ORCPT ); Mon, 19 Oct 2015 09:20:55 -0400 Date: Mon, 19 Oct 2015 15:20:53 +0200 From: Michal Hocko To: Vladimir Davydov Cc: Andrew Morton , "Kirill A. Shutemov" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: do not inc NR_PAGETABLE if ptlock_init failed Message-ID: <20151019132053.GI11998@dhcp22.suse.cz> References: <1445256881-5205-1-git-send-email-vdavydov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445256881-5205-1-git-send-email-vdavydov@virtuozzo.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Michal Hocko > --- > 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: email@kvack.org -- Michal Hocko SUSE Labs