From patchwork Mon Feb 19 19:44:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10228805 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B25F602B7 for ; Mon, 19 Feb 2018 20:05:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D8C128B3E for ; Mon, 19 Feb 2018 20:05:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0048E28B81; Mon, 19 Feb 2018 20:05:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B19F728B3E for ; Mon, 19 Feb 2018 20:05:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753589AbeBSTqG (ORCPT ); Mon, 19 Feb 2018 14:46:06 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44500 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753466AbeBSTqF (ORCPT ); Mon, 19 Feb 2018 14:46:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lq0KAfEPYtiKruNwOFJOKxTXbeH1R7BrqH9P+K9vP8g=; b=AYWxs/6YkXIhVEBfa2ysWvMm+ 6LSc6Q3uD9mzsWWhS8+g1WWo4tz7BZ48YP68MiW9Tao/qI5yJFbtU5EqXHbpO30ESV/aERRkcYGJx TZ+vpVy/TQNv0xfruqawk4CR7vYuGj3q55t/I5Kot7gTC23enXsFoeySO4VTF33shYbJTISeXeX9N ub/tlChUYsUtafT5jrdUfcq+PNSJKFrywWVoRcI+wWsnq2kKkpDtWdTJsA36RiGQyH7nopfSH7Z3Z 3FEdJofJNM83QWBItU4X5mQmIso/nDgWaDHXtN3es3j7CDlCC904FcRJSiuzfZ3EjKaRet8E1qzSD 1nbnvEb8A==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1enrNz-0001jl-JZ; Mon, 19 Feb 2018 19:46:03 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v7 01/61] radix tree test suite: Check reclaim bit Date: Mon, 19 Feb 2018 11:44:56 -0800 Message-Id: <20180219194556.6575-2-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180219194556.6575-1-willy@infradead.org> References: <20180219194556.6575-1-willy@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox In order to test the memory allocation failure paths, the radix tree test suite fails allocations if __GFP_NOWARN is set. That happens to work for the radix tree implementation, but the semantics we really want are that we want to fail allocations which are not GFP_KERNEL. Do this by failing allocations which don't have the DIRECT_RECLAIM bit set. Signed-off-by: Matthew Wilcox --- tools/testing/radix-tree/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index 6903ccf35595..f7f3caed3650 100644 --- a/tools/testing/radix-tree/linux.c +++ b/tools/testing/radix-tree/linux.c @@ -29,7 +29,7 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, int flags) { struct radix_tree_node *node; - if (flags & __GFP_NOWARN) + if (!(flags & __GFP_DIRECT_RECLAIM)) return NULL; pthread_mutex_lock(&cachep->lock);