Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754329AbdGJPcl (ORCPT ); Mon, 10 Jul 2017 11:32:41 -0400 Received: from resqmta-ch2-04v.sys.comcast.net ([69.252.207.36]:51100 "EHLO resqmta-ch2-04v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754292AbdGJPcj (ORCPT ); Mon, 10 Jul 2017 11:32:39 -0400 Date: Mon, 10 Jul 2017 10:32:13 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Alexander Potapenko cc: Andrew Morton , Dmitriy Vyukov , Kostya Serebryany , LKML , Linux Memory Management List , Pekka Enberg , David Rientjes , Joonsoo Kim Subject: Re: [PATCH] slub: make sure struct kmem_cache_node is initialized before publication In-Reply-To: Message-ID: References: <20170707083408.40410-1-glider@google.com> <20170707132351.4f10cd778fc5eb58e9cc5513@linux-foundation.org> Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfNkhhek+G8aUD5v/vqcItJvq6yXSZLPt2otoLdtamAmxoSoZvivHa9TJ3vHNQq9yVaXKUsKwUy2HN6HWROTC5WWDtz0qqIQSBYA2Ddg4PZA239sxWHVj fFoLjawgCLBmWIWt/xiZGlZjX7X304ErJwyMkYfYfQNj4GgacUuFy5vcuuqijGAAPElBawyXoYrVJGJpin5MVDKpaSNpguMYlwbqCCg+WEc70v2GfmV69MKj zV15NWpuiIapqvvT7LmbdQoYDxd56jDoQOUkS7LywIFFBVakdHJSHM1TcWd/LFVlVCMnxivL8SzaFlwuc2zgxNCb3LvyiHNY9iaiRDlkhWPHoBcZvWYXdgbL reEDD2M1pjM/j/y+a9ogi2eIqyZYFn+JwWwIa8vlwYIve0KmmlWCNToc6b+BkXacm9KQ1zMV Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1017 Lines: 26 On Mon, 10 Jul 2017, Alexander Potapenko wrote: > >> Could the slab maintainers please take a look at these and also have a > >> think about Alexander's READ_ONCE/WRITE_ONCE question? > > > > Was I cced on these? > I've asked Andrew about READ_ONCE privately. Please post to a mailing list and cc the maintainers? > Since unfreeze_partials() sees uninitialized value of n->list_lock, I > was suspecting there's a data race between unfreeze_partials() and > init_kmem_cache_nodes(). I have not seen the details but I would suspect that this is related to early boot issues? The list lock is initialized upon slab creation and at that time no one can get to the kmem_cache structure. There are a couple of boot time slabs that will temporarily be available. and released upon boot completion. > If so, reads and writes to s->node[node] must be acquire/release > atomics (not actually READ_ONCE/WRITE_ONCE, but > smp_load_acquire/smp_store_release). Can we figure the reason for these out before proposing fixes?