From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758600AbbJHVRh (ORCPT ); Thu, 8 Oct 2015 17:17:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49165 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756536AbbJHVRg (ORCPT ); Thu, 8 Oct 2015 17:17:36 -0400 Date: Thu, 8 Oct 2015 14:17:35 -0700 From: Andrew Morton To: Vladimir Davydov Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , , Subject: Re: [PATCH 2/3] slab_common: clear pointers to per memcg caches on destroy Message-Id: <20151008141735.d545d3fa1ab0244f69c41cdf@linux-foundation.org> In-Reply-To: <833ae913932949814d1063e11248e6747d0c3a2b.1444319304.git.vdavydov@virtuozzo.com> References: <6a18aab2f1c3088377d7fd2207b4cc1a1a743468.1444319304.git.vdavydov@virtuozzo.com> <833ae913932949814d1063e11248e6747d0c3a2b.1444319304.git.vdavydov@virtuozzo.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 8 Oct 2015 19:02:40 +0300 Vladimir Davydov wrote: > Currently, we do not clear pointers to per memcg caches in the > memcg_params.memcg_caches array when a global cache is destroyed with > kmem_cache_destroy. It is fine if the global cache does get destroyed. > However, a cache can be left on the list if it still has active objects > when kmem_cache_destroy is called (due to a memory leak). If this > happens, the entries in the array will point to already freed areas, > which is likely to result in data corruption when the cache is reused > (via slab merging). It's important that we report these leaks so the kernel bug can get fixed. The patch doesn't add such detection and reporting, but it could do so?