From patchwork Wed May 7 20:03:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Rientjes X-Patchwork-Id: 4131681 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7E52BFF02 for ; Wed, 7 May 2014 20:03:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85507201BA for ; Wed, 7 May 2014 20:03:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DF0D20179 for ; Wed, 7 May 2014 20:03:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751542AbaEGUDp (ORCPT ); Wed, 7 May 2014 16:03:45 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:42784 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbaEGUDn (ORCPT ); Wed, 7 May 2014 16:03:43 -0400 Received: by mail-pa0-f44.google.com with SMTP id ld10so1669306pab.3 for ; Wed, 07 May 2014 13:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version:content-type; bh=A8VqaONVXSplvgvULv4eWWvxnB/L5CY3MW6KUkRnpFA=; b=WErNa6G4grB/lSx1WCkhAw05NHtKAgmnN9bkqcl8sNqBoDt+ItSJ6rnxIjEVn27Z52 l45LtUiKTTb2F76tbgO51sBaDNPzZHxCnH433LrYtfKyOrWAfSog+KHtk6zgqjuTA17q 9LSLCvVY5vU+FxAuZHESf53O2lacUKNjcfzvLj6+E6q+1LeXd5PG1/EObGqUzfpbbfiQ c8ubNvBD47hmAKQQKyGAQgHWAUWLsLlxKURRUT+w5n7y+m//Ea5gf26XwwoY3//JU5bp 0u58MX8qWBhJbxEDktaMngSS2elwlSwJ6Z6L9qj8usCShZjtSu9dgn1C5QDNwLHSE5HI y+0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=A8VqaONVXSplvgvULv4eWWvxnB/L5CY3MW6KUkRnpFA=; b=PZzc4xcobc/YrrISzcjm/LldX47Gx4iBI5DSukYJS03U3fQDGfbJHRisbP7X7Gt5Bl yREzYJa0n+tHhwMs58BDEGgSLRbedWJTjyJHMZIQ7oKVE9c8keEYrv2TtdYArE5GoLSz CZ+wrjGCGuUT8AOh65f2Hyf2TpsPu49mXS8blN5u5oofToG/Azg8bb1C2GZM+LL4xEAa CitWTuErE9PG2DMVrbuGh/KykjQ5vGlniG75S0ELe507T8lnJBCTvTdR29QUHqp9hjCH lMU1wnTXAR2UDYvA1mAnhcz30bP1cHZAMtGhDH3w/AYuUc79W1w5DhrJpRBpsMgAz0mo 7GwQ== X-Gm-Message-State: ALoCoQkHHM0TZAFEJLBbMb4e2TmyqpiJ0tYw/VekyRjJRgmp3dX3neY9McBLjyrrK0Yy5oCuUldz X-Received: by 10.66.161.69 with SMTP id xq5mr22585722pab.62.1399493022995; Wed, 07 May 2014 13:03:42 -0700 (PDT) Received: from [2620:0:1008:1101:be30:5bff:fed8:5e64] ([2620:0:1008:1101:be30:5bff:fed8:5e64]) by mx.google.com with ESMTPSA id kn10sm4675584pbd.60.2014.05.07.13.03.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 13:03:42 -0700 (PDT) Date: Wed, 7 May 2014 13:03:41 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Trond Myklebust , David Miller cc: Jeff Layton , Marc Dietrich , "J. Bruce Fields" , linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org, Mel Gorman Subject: [patch] net, sunrpc: suppress allocation warning in rpc_malloc() In-Reply-To: <20140505070812.470c66bd@tlielax.poochiereds.net> Message-ID: References: <2562595.ix17LO7uqe@fb07-iapwap2> <20140505070812.470c66bd@tlielax.poochiereds.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP rpc_malloc() allocates with GFP_NOWAIT without making any attempt at reclaim so it easily fails when low on memory. This ends up spamming the kernel log: SLAB: Unable to allocate memory on node 0 (gfp=0x4000) cache: kmalloc-8192, object size: 8192, order: 1 node 0: slabs: 207/207, objs: 207/207, free: 0 rekonq: page allocation failure: order:1, mode:0x204000 CPU: 2 PID: 14321 Comm: rekonq Tainted: G O 3.15.0-rc3-12.gfc9498b-desktop+ #6 Hardware name: System manufacturer System Product Name/M4A785TD-V EVO, BIOS 2105 07/23/2010 0000000000000000 ffff880010ff17d0 ffffffff815e693c 0000000000204000 ffff880010ff1858 ffffffff81137bd2 0000000000000000 0000001000000000 ffff88011ffebc38 0000000000000001 0000000000204000 ffff88011ffea000 Call Trace: [] dump_stack+0x4d/0x6f [] warn_alloc_failed+0xd2/0x140 [] __alloc_pages_nodemask+0x7e9/0xa30 [] kmem_getpages+0x58/0x140 [] fallback_alloc+0x1d6/0x210 [] ____cache_alloc_node+0x123/0x150 [] __kmalloc+0x203/0x490 [] rpc_malloc+0x32/0xa0 [sunrpc] [] call_allocate+0xb9/0x170 [sunrpc] [] __rpc_execute+0x88/0x460 [sunrpc] [] rpc_execute+0x59/0xc0 [sunrpc] [] rpc_run_task+0x6b/0x90 [sunrpc] [] nfs4_call_sync_sequence+0x51/0x80 [nfsv4] [] _nfs4_do_setattr+0x1ed/0x280 [nfsv4] [] nfs4_do_setattr+0x72/0x180 [nfsv4] [] nfs4_proc_setattr+0xbc/0x140 [nfsv4] [] nfs_setattr+0xd8/0x240 [nfs] [] notify_change+0x231/0x380 [] chmod_common+0xfc/0x120 [] SyS_chmod+0x40/0x90 [] system_call_fastpath+0x1a/0x1f ... If the allocation fails, simply return NULL and avoid spamming the kernel log. Reported-by: Marc Dietrich Signed-off-by: David Rientjes --- net/sunrpc/sched.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -832,7 +832,8 @@ static void rpc_async_schedule(struct work_struct *work) * @size: requested byte size * * To prevent rpciod from hanging, this allocator never sleeps, - * returning NULL if the request cannot be serviced immediately. + * returning NULL and suppressing warning if the request cannot be serviced + * immediately. * The caller can arrange to sleep in a way that is safe for rpciod. * * Most requests are 'small' (under 2KiB) and can be serviced from a @@ -845,7 +846,7 @@ static void rpc_async_schedule(struct work_struct *work) void *rpc_malloc(struct rpc_task *task, size_t size) { struct rpc_buffer *buf; - gfp_t gfp = GFP_NOWAIT; + gfp_t gfp = GFP_NOWAIT | __GFP_NOWARN; if (RPC_IS_SWAPPER(task)) gfp |= __GFP_MEMALLOC;