Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753934AbcLMU0S (ORCPT ); Tue, 13 Dec 2016 15:26:18 -0500 Received: from p3plsmtps2ded03.prod.phx3.secureserver.net ([208.109.80.60]:43046 "EHLO p3plsmtps2ded03.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753313AbcLMU0O (ORCPT ); Tue, 13 Dec 2016 15:26:14 -0500 x-originating-ip: 72.167.245.219 From: Matthew Wilcox To: linux-kernel@vger.kernel.org, Andrew Morton Cc: Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Konstantin Khlebnikov , Ross Zwisler , "Kirill A . Shutemov" , Tejun Heo Subject: [PATCH 0/5] Additional radix tree patches for 4.10 Date: Tue, 13 Dec 2016 14:21:27 -0800 Message-Id: <1481667692-14500-1-git-send-email-mawilcox@linuxonhyperv.com> X-Mailer: git-send-email 1.7.4.1 X-CMAE-Envelope: MS4wfDWEW8apudIMMuPP0rADEhVLH0goLXGBEI2XC4v0h5o0l1hbO9vhlyPcMS+Jw6O34xoH46DN1E0iFCPxZlE5hq/WFSINsQ+lVhKnghxDsCi3zNknI/sF OC2jEvJxAJqW8RQGyzPEr0f4dLkD7FMamxPenzYu827qrSSALSzbWMqCsFRWOlwltiBtVeLFRJQ1/sy9FWsz04AtSk+inAb6ztSw7BVoOAdIR710LxZ5Dt/i o3mOe0f7SlCjPMPjpq7RhpVZuOeFpjVWPAFz4K5V8rBRkD+U9TM0KaXfU9/ArdNTQKfvhaCFMyTxumI09P0mS1QzeLjEEgbEtVxcEWKoVRf6RW79hXTi7XNh lY8cirU0MUS9xeFstBJgIbBpMSR48e9E3rRsduqC9mgAU237a6v0lG6p2b8JltjErKFCSPnh3Tw1TuR4fjoRaflwuYYXiDLgV7WlfFjOpMpO52pwP/OvlnqN C4UCyxd64riWtAF+ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2944 Lines: 65 From: Matthew Wilcox Hi Andrew, One bug has popped up in testing which is reasonably hard to hit (fixed by patch 2 in this series). I needed to change the test suite to be able to catch the bug in action. The test suite was returning freed memory to glibc's malloc, but we have to keep a cache of objects in order to notice that we freed something non-zero and then neglected to initialise it back to zero upon reallocation. Please drop the existing "reimplement IDR and IDA using the radix tree" patch from your queue and replace it with these five patches. I'd like to see the first four patches head to Linus along with the rest of the radix tree patches, and we can continue with the plan of holding patch 5 until 4.11. I took your suggestion of moving as much as possible of the IDA and IDR functionality back to idr.c. That prompted creation of some nicer APIs, such as radix_tree_iter_delete() and radix_tree_iter_lookup(). There are also some good bugs fixed in this revision, such as: - returning the correct error value from ida_get_new_above() if we run out of memory, - handling attempts to allocate from a full IDA correctly. - Correctly handle deleting the only entry at root with radix_tree_iter_delete() I wrote test cases for all these situations, so they shouldn't regress again. Matthew Wilcox (5): radix tree test suite: Cache recently freed objects radix-tree: Ensure counts are initialised radix tree test suite: Add new tag check radix tree test suite: Delete unused rcupdate.c Reimplement IDR and IDA using the radix tree include/linux/idr.h | 138 ++-- include/linux/radix-tree.h | 53 +- init/main.c | 3 +- lib/idr.c | 1144 ++++++------------------------- lib/radix-tree.c | 358 ++++++++-- tools/include/linux/spinlock.h | 4 + tools/testing/radix-tree/.gitignore | 1 + tools/testing/radix-tree/Makefile | 10 +- tools/testing/radix-tree/idr-test.c | 200 ++++++ tools/testing/radix-tree/linux.c | 48 +- tools/testing/radix-tree/linux/export.h | 1 + tools/testing/radix-tree/linux/gfp.h | 8 +- tools/testing/radix-tree/linux/idr.h | 1 + tools/testing/radix-tree/linux/kernel.h | 2 + tools/testing/radix-tree/linux/slab.h | 5 - tools/testing/radix-tree/main.c | 6 + tools/testing/radix-tree/multiorder.c | 45 +- tools/testing/radix-tree/rcupdate.c | 86 --- tools/testing/radix-tree/tag_check.c | 3 + tools/testing/radix-tree/test.h | 2 + 20 files changed, 914 insertions(+), 1204 deletions(-) create mode 100644 tools/include/linux/spinlock.h create mode 100644 tools/testing/radix-tree/idr-test.c create mode 100644 tools/testing/radix-tree/linux/idr.h delete mode 100644 tools/testing/radix-tree/rcupdate.c -- 2.10.2