From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752607AbcKQXVk (ORCPT ); Thu, 17 Nov 2016 18:21:40 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33528 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbcKQXVh (ORCPT ); Thu, 17 Nov 2016 18:21:37 -0500 Date: Fri, 18 Nov 2016 02:21:34 +0300 From: "Kirill A. Shutemov" To: Johannes Weiner Cc: Andrew Morton , Jan Kara , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 2/9] mm: khugepaged: fix radix tree node leak in shmem collapse error path Message-ID: <20161117232134.GB8358@node> References: <20161117191138.22769-1-hannes@cmpxchg.org> <20161117191138.22769-3-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161117191138.22769-3-hannes@cmpxchg.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2016 at 02:11:31PM -0500, Johannes Weiner wrote: > The radix tree counts valid entries in each tree node. Entries stored > in the tree cannot be removed by simpling storing NULL in the slot or > the internal counters will be off and the node never gets freed again. > > When collapsing a shmem page fails, restore the holes that were filled > with radix_tree_insert() with a proper radix tree deletion. > > Fixes: f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages") > Reported-by: Jan Kara > Signed-off-by: Johannes Weiner Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id BDD216B0371 for ; Thu, 17 Nov 2016 18:21:37 -0500 (EST) Received: by mail-wm0-f71.google.com with SMTP id u144so1131643wmu.1 for ; Thu, 17 Nov 2016 15:21:37 -0800 (PST) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com. [2a00:1450:400c:c09::241]) by mx.google.com with ESMTPS id zl8si4952474wjb.48.2016.11.17.15.21.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Nov 2016 15:21:36 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id m203so535741wma.3 for ; Thu, 17 Nov 2016 15:21:36 -0800 (PST) Date: Fri, 18 Nov 2016 02:21:34 +0300 From: "Kirill A. Shutemov" Subject: Re: [PATCH 2/9] mm: khugepaged: fix radix tree node leak in shmem collapse error path Message-ID: <20161117232134.GB8358@node> References: <20161117191138.22769-1-hannes@cmpxchg.org> <20161117191138.22769-3-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161117191138.22769-3-hannes@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Andrew Morton , Jan Kara , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com On Thu, Nov 17, 2016 at 02:11:31PM -0500, Johannes Weiner wrote: > The radix tree counts valid entries in each tree node. Entries stored > in the tree cannot be removed by simpling storing NULL in the slot or > the internal counters will be off and the node never gets freed again. > > When collapsing a shmem page fails, restore the holes that were filled > with radix_tree_insert() with a proper radix tree deletion. > > Fixes: f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages") > Reported-by: Jan Kara > Signed-off-by: Johannes Weiner Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov -- 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