From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17655 invoked by alias); 16 May 2012 16:04:27 -0000 Received: (qmail 17494 invoked by uid 22791); 16 May 2012 16:04:23 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 May 2012 16:03:44 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 7B26B2F78001 for ; Wed, 16 May 2012 17:03:43 +0100 (BST) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nxeu2g29UeS8; Wed, 16 May 2012 17:03:39 +0100 (BST) From: bugzilla-daemon@bugs.ecos.sourceware.org To: ecos-patches@ecos.sourceware.org Subject: [Bug 1001344] Allow nc_test_slave for lwIP to compile for targets with 128KiB RAM. X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ilijak@siva.com.mk X-Bugzilla-Status: NEW X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Attachment #1754 is obsolete In-Reply-To: References: X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 16 May 2012 16:04:00 -0000 Message-Id: <20120516160338.E9B9A2F78004@mail.ecoscentric.com> Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2012-05/txt/msg00054.txt.bz2 Please do not reply to this email. Use the web interface provided at: http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001344 Ilija Kocho changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #1754|0 |1 is obsolete| | --- Comment #21 from Ilija Kocho 2012-05-16 17:03:32 BST --- Created an attachment (id=1759) --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1759) Reduce stack usage of nc_test_slave fix MAX_BUF 20110516 (In reply to comment #20) > First, as per bug 1001586 (specifically: > http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001586#c5 ), I would have > thought the buffer sizes could be smaller: 10240+16+maybe a little more just in > case. You're right, it may make difference with targets with small memory. My figures for both buffer and stack sizes come from early experiments. I should have revised them. > > As for the general idea with this patch, I think it is unwise to use fixed > constant sizes for stacks. It's doomed, especially once you involve other, more > stack hungry, architectures than ARM or Cortex. > > To get smaller stacks I would suggest starting from > CYGNUM_HAL_STACK_SIZE_MINIMUM, and adding on some numbers of multiples of > CYGNUM_HAL_STACK_FRAME_SIZE plus an extra constant to roughly cover the stack > local variables in the call frame you think you are likely to get, and then add > some more for safety. You can do it so that the numbers you get come out as the > fixed constants you've already determined work for you on the Kinetis, but it > at least means it's more likely to continue to work on other targets. You may > find CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT useful to better inform your > decisions. > Indeed, measurement often offers the best guess :) I just did it for Kinetis target and here's the printout: Stack: MINIMUM == 1360, TYPICAL == 3920 Stack usage: IDLE thread: 340 Background load threads: 244 200 252 252 200 Main thread : 264 Looks like we have pretty much large margin with CYGNUM_HAL_STACK_SIZE_MINIMUM. Then we might use the attached patch with minimal changes. -- Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.