Received: by 10.223.185.116 with SMTP id b49csp1128179wrg; Tue, 20 Feb 2018 13:55:35 -0800 (PST) X-Google-Smtp-Source: AH8x224sK37QxrgvstXhRxlELzfuuInVLiCvbXlWsjzc9B6lkh9K80Qq7/zpN/3SfdfpPB75XSh6 X-Received: by 10.98.40.71 with SMTP id o68mr984855pfo.217.1519163735058; Tue, 20 Feb 2018 13:55:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519163735; cv=none; d=google.com; s=arc-20160816; b=EP70AAvcO4mx9hZ78ZEyZZvBD04C3aY+ff9ajs7tmchMv+uxoZ5FHtkkhukjdaelQE m9xZMnvc9QOCSmn7ZAOmT6C4bPBYq0eOvIVpqcWFySc6yB5w0rToK4d/3vt4+eVT4TAq RzUnzQxHdA40nIKoEJN4rybJTjNS+RSRUVL5K6oKiT4CzhmC8ZHRi7Tl/A/Eg1iD3EbB pwTf/Bf7yO91G3U5TWme+T3QKGWbQs3XshY6KiVtFHSMSYYrooVeHFsY8vv5M2ZGuoQj 5saat0SzFXECw9bpAY0WAArAe++itCqk3UPQUrvp0EwHDuPLDAObiME+wvPhqyLzeTwV KPOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Vadmch1c4fF6hPWZD07R3awLP7TSamKankInKFq8D9E=; b=Noab4O/U1EqtnXYv9/s03Y+rJBxpVho6HbL644YNASbdJwQl6xrG4MLyEgxrnPZocW j73YscNwTmWqE33AD7FYmNjS7F9HAgFIMRCC9Aj13KZRQ/C4f3ZFxwwTBDAPt2K42yxm yezVq5S3IF+hSIjpaXmoI8uw5k1mS2o3mg35tcVrv0Wa4jRpPk9L/9R9kgBQrAPbPEBF SF+AdAPnbdObBFDVI+XfjJHgDJowqVikXD8xeHVJMfhATDTXSYhH2Q3RZCHXow0c+i85 KuInuyRv0EiSBDbMBS6BwyHACtiqUn8zwgtb/F5r2pK8EeT+0TLUJoG6RicztB90yIGM AXeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Huxq1tc7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22-v6si394625plo.206.2018.02.20.13.55.18; Tue, 20 Feb 2018 13:55:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Huxq1tc7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751131AbeBTVyj (ORCPT + 99 others); Tue, 20 Feb 2018 16:54:39 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:37287 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbeBTVyh (ORCPT ); Tue, 20 Feb 2018 16:54:37 -0500 Received: by mail-qt0-f196.google.com with SMTP id d26so18394563qtj.4; Tue, 20 Feb 2018 13:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Vadmch1c4fF6hPWZD07R3awLP7TSamKankInKFq8D9E=; b=Huxq1tc7d/gcvEwt4znvxs/mqRmri/xEFxchrRcDfI06OYVFQ9uQaIOqYYZaCc52M3 1fPeF+4ZDW46/F7gsD0KxtnRxaNTA2sqlrifELgAqkSGuBkSJpC3kx8WfIDZUSo2qLc5 3SpstCxmLLJA3QXGy7bZOhOdkZAz37ip2ubFk6kbRrcgVNuM28y6PUye9LrgydMpGhn+ kowLiH63UG/EWqP6ee/+DMcKbXUS+AvgNi5d2BaeKrHWLNCRXdzvz0PyQSzMv2k0ab37 7ra8UTQCv0kgmrFkjEX1J/D7AxG8q57/xsLGLOvShM5OE5dpNjYql9qK1IVmQtzdHFqq foFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Vadmch1c4fF6hPWZD07R3awLP7TSamKankInKFq8D9E=; b=kPdHEH/1LdNcEhpLX/8KoT0XIIhAUxoFVk4mHR6CAPcluD/lRARlUhK1D1F5CFI6/3 Uw+ywpYiuqnsJAOkZXMCgmHMn+CRmOJ81iisnMO1ZVc10z0WsufXUsUXlh6Ttnca3eft 7EHTVDS0LszNMVOTpCljTbeKNDPqd9oISA3XcePjin+Ok/j3gu4IEV95rNXpRYlKhiSE bXrOk+Yq2uz1htIoqvtb/6RkB7hhiAJzQuFQivLFczmaeG787JaQjtx2UCfX84BcnSgO TASBfqQ4YrwWB8r7ZpqdM0CFlcEdzjj4/N4+kloUwDV7RlguuyBTiErGKwEmelbP8Si1 Z0cQ== X-Gm-Message-State: APf1xPB+cUghsrTEyjSGbjN9PpvaMQVVz43XQPUJ3XMoyWqL8t5UnWcV 3kfWQZF1r0/ZZipNVU1FM2MdjFLDfYCSNx5qlp4= X-Received: by 10.237.33.4 with SMTP id 4mr1885067qtc.132.1519163676325; Tue, 20 Feb 2018 13:54:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.198.17 with HTTP; Tue, 20 Feb 2018 13:54:35 -0800 (PST) In-Reply-To: References: <20180220205924.2035765-1-arnd@arndb.de> From: Arnd Bergmann Date: Tue, 20 Feb 2018 22:54:35 +0100 X-Google-Sender-Auth: e7oMkNTfjEUANkBFBHEnbIESpH8 Message-ID: Subject: Re: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant To: Parav Pandit Cc: Doug Ledford , Jason Gunthorpe , Leon Romanovsky , Sagi Grimberg , Bart Van Assche , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 20, 2018 at 10:14 PM, Parav Pandit wrote: > Hi Arnd Bergmann, > >> -----Original Message----- >> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma- >> owner@vger.kernel.org] On Behalf Of Arnd Bergmann >> Sent: Tuesday, February 20, 2018 2:59 PM >> To: Doug Ledford ; Jason Gunthorpe >> Cc: Arnd Bergmann ; Leon Romanovsky >> ; Sagi Grimberg ; Bart Van Assche >> ; linux-rdma@vger.kernel.org; linux- >> kernel@vger.kernel.org >> Subject: [PATCH] RDMA/core: reduce IB_POLL_BATCH constant >> >> The ib_wc structure has grown to much that putting 16 of them on the stack hits >> the warning limit for dangerous kernel stack consumption: >> >> drivers/infiniband/core/cq.c: In function 'ib_process_cq_direct': >> drivers/infiniband/core/cq.c:78:1: error: the frame size of 1032 bytes is larger >> than 1024 bytes [-Werror=frame-larger-than=] >> >> Using half that number brings us comfortably below that limit again. >> >> Fixes: 02d8883f520e ("RDMA/restrack: Add general infrastructure to track >> RDMA resources") > > It is not clear to me how above commit 02d8883f520e introduced this stack issue. My mistake, I misread the git history. I did a proper bisection now and ended up with the commit that added the IB_POLL_BACK sized array on the stack, i.e. commit 246d8b184c10 ("IB/cq: Don't force IB_POLL_DIRECT poll context for ib_process_cq_direct") > Bodong and I came across ib_wc size increase in [1] and it was fixed in [2]. > Did you hit this error after/before applying patch [2]? > > [1] https://www.spinics.net/lists/linux-rdma/msg50754.html > [2] https://patchwork.kernel.org/patch/10159623/ I did the analysis a few weeks ago when I first hit the problem but didn't send it out at the time. Today I saw the problem still persists on mainline (4.16-rc2), which does contain the patch from [2]. What I see is that 'ib_wc' is now exactly 59 bytes on 32-bit ARM, plus 5 bytes of padding, so 16 of them gets us exactly the warning limit, and then there are a few bytes for the function itself. Arnd