From owner-freebsd-bugs@freebsd.org Tue May 23 19:35:34 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9A7ED7BDF8 for ; Tue, 23 May 2017 19:35:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEA0E1836 for ; Tue, 23 May 2017 19:35:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v4NJZY56094498 for ; Tue, 23 May 2017 19:35:34 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 219476] [i386] 11.1-PRERELEASE double panics due to low kern.kstack_pages default Date: Tue, 23 May 2017 19:35:34 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: eugen@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2017 19:35:35 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219476 Bug ID: 219476 Summary: [i386] 11.1-PRERELEASE double panics due to low kern.kstack_pages default Product: Base System Version: 11.0-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: eugen@freebsd.org stable/11 got lots of kernel level code that abuses small default stack of = i386 kernel threads: ZFS, IPSEC, SCTP, device drivers etc. Overflow of kernel st= ack produces "double fault" panics. kern.kstack_pages is loader tunnable now for i386. The system should be sta= ble out of the box, so we should increase default for kern.kstack_pages. Loader tunnable can serve users of i386 systems that are unhappy with new default, they can decrease it with /boot/loader.conf Some examples: * sys/netinet/sctp_pcb.c, function sctp_load_addresses_from_init() allocates 2184 bytes on stack (disassemble: sub $0x888,%esp); * sys/netinet/sctp_auth.c: sctp_auth_get_cookie_params(): 1592 bytes on sta= ck; * src/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c: ar9300_eeprom_restore_internal_address(): 2092 bytes on stack; * sys/contrib/dev/ath/ath_hal/ar9300/ar9300_paprd.c: create_pa_curve(): 1416 bytes; * sys/libkern/zlib.c: huft_build(): 1420 bytes; And so on. Here is "top-list" for my home router custom kernel (1GB RAM, no swap): Bytes-on-stack In-module 2184 sctp_pcb.o 2092 ar9300_eeprom.o 2080 kern_linker.o 1664 cryptosoft.o 1592 sctp_auth.o 1536 glxsb_hash.o 1420 zlib.o 1416 ar9300_paprd.o 1352 scsi_da.o 1344 nfs_nfsdport.o 1328 vm_object.o 1312 fortuna.o 1232 cam_periph.o 1224 zlib.o 1192 cam_xpt.o 1192 ata_da.o 1184 cam_xpt.o 1168 ata_da.o 1160 sctp_output.o Some of "network hot path" subroutines not shown here do abuse kernel stack too, for example SHA256_Transform() from sys/crypto/sha2/sha256c.c that may= be actively used with IPSEC processing. ae@'s https://reviews.freebsd.org/D10869 deals with IPSEC in part and helps= in my case, at least while there is no ZFS involved. However, it is impossible= to perform similar cleanup for each and every kernel subsystem in near future = and double panics with current defaults are bad too. --=20 You are receiving this mail because: You are the assignee for the bug.=