Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4819454imb; Thu, 7 Mar 2019 01:02:43 -0800 (PST) X-Google-Smtp-Source: APXvYqw1y8nBREwsf1XLtyiViBgVEP2nRQ5FOjydFewdnk/3hnznmbQOsK4AG4xWHahURVO/ygFe X-Received: by 2002:a63:618d:: with SMTP id v135mr10410401pgb.238.1551949362866; Thu, 07 Mar 2019 01:02:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551949362; cv=none; d=google.com; s=arc-20160816; b=PqbM5X3O8RrCCQEMw3oDNGmnZnrVhW3laAhs6D3HQGC20XDa++k4Lj276eFJuAJGBA 7N2u/mw12is4+prV1AEmdZeZy18xFDzxSivQuFGpG5ibB/qZ+VFcqkXaE3ReANngAQC3 jpyngqm5Pm70+Dg2qxUlYpt1e3ibogaYwX7xw+E5E/jeREGY4BwIIBc5AGpu/ipYyuE6 iqZUOlcAGBjq93zdgoiQIQGp1TtCRzfPEoY4TDKQf6xDVCqYsQaR7iabGaLtJTd+CY80 BG31LAXiPp1v3fV++3GmUVvmSNjqEuXTfhxMN+qAU4CKuKM55lcr7Y4IOk14wSwmCrSw hglA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rdaj4YfLQYSj/cnl9hJBRe4K+dwlE3EteZkcV9AYs90=; b=JFIJeA0XtODgXw5f6lDnhFK2H8uL9BwW7ETMuDyeGtiEGswAL+tqCZawhMuSLi54lB rGzzYwjnb8vOgHVB+m6ywovZV+M+M1PZ4/eTFW4aYBS6ssMdvhbfBH5NZ8AdGqy0DgGQ nlTbp5odMmuO+w/0BjpcEUBE5IGwoy7MmfBc4hl+1tTmeYQkvoCbAmpmAAAbY8kNCsf2 nRevuJaojDTg9zN7BE7zez69+CDeJhGFnRUphYb9FMMxhA47gxakKoKl/eDIPrqbrrMT ysJeXLMVWoNoEHVTfX2/qDj4qEq2uqUgk7t8Q6tTjt7BFRC6lZTIdxOcPU4vGl1zgLRf L+oA== ARC-Authentication-Results: i=1; mx.google.com; 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 a21si3594519pls.367.2019.03.07.01.02.26; Thu, 07 Mar 2019 01:02:42 -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; 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 S1726195AbfCGJCA (ORCPT + 99 others); Thu, 7 Mar 2019 04:02:00 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:41079 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbfCGJCA (ORCPT ); Thu, 7 Mar 2019 04:02:00 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MDhQt-1hCZjv0PiR-00Akoh; Thu, 07 Mar 2019 10:01:48 +0100 From: Arnd Bergmann To: linux-fsdevel@vger.kernel.org Cc: Nick Desaulniers , Alexander Viro , Andrew Morton , Andi Kleen , Christoph Hellwig , Eric Dumazet , Arnd Bergmann , "Darrick J. Wong" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH] fs/select: avoid clang stack usage warning Date: Thu, 7 Mar 2019 10:01:36 +0100 Message-Id: <20190307090146.1874906-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-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AUpoF7WSf6uQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The select() implementation is carefully tuned to put a sensible amount of data on the stack for holding a copy of the user space fd_set, but not too large to risk overflowing the kernel stack. When building a 32-bit kernel with clang, we need a little more space than with gcc, which often triggers a warning: fs/select.c:619:5: error: stack frame size of 1048 bytes in function 'core_sys_select' [-Werror,-Wframe-larger-than=] int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, I experimentally found that for 32-bit ARM, reducing the maximum stack usage by 64 bytes keeps us reliably under the warning limit again. Signed-off-by: Arnd Bergmann --- include/linux/poll.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/poll.h b/include/linux/poll.h index 7e0fdcf905d2..1cdc32b1f1b0 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h @@ -16,7 +16,11 @@ extern struct ctl_table epoll_table[]; /* for sysctl */ /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating additional memory. */ +#ifdef __clang__ +#define MAX_STACK_ALLOC 768 +#else #define MAX_STACK_ALLOC 832 +#endif #define FRONTEND_STACK_ALLOC 256 #define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC #define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC -- 2.20.0