From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by kanga.kvack.org (Postfix) with ESMTP id E36D76B003D for ; Thu, 29 May 2014 03:40:47 -0400 (EDT) Received: by mail-pb0-f45.google.com with SMTP id um1so12586602pbc.32 for ; Thu, 29 May 2014 00:40:47 -0700 (PDT) Received: from lgeamrelo04.lge.com (lgeamrelo04.lge.com. [156.147.1.127]) by mx.google.com with ESMTP id eq15si27226839pac.222.2014.05.29.00.40.46 for ; Thu, 29 May 2014 00:40:47 -0700 (PDT) Date: Thu, 29 May 2014 16:41:17 +0900 From: Minchan Kim Subject: Re: virtio ring cleanups, which save stack on older gcc Message-ID: <20140529074117.GI10092@bbox> References: <87oayh6s3s.fsf@rustcorp.com.au> <1401348405-18614-1-git-send-email-rusty@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1401348405-18614-1-git-send-email-rusty@rustcorp.com.au> Sender: owner-linux-mm@kvack.org List-ID: To: Rusty Russell Cc: Linus Torvalds , Dave Chinner , Jens Axboe , Linux Kernel Mailing List , Andrew Morton , linux-mm , "H. Peter Anvin" , Ingo Molnar , Peter Zijlstra , Mel Gorman , Rik van Riel , Johannes Weiner , Hugh Dickins , "Michael S. Tsirkin" , Dave Hansen , Steven Rostedt Hello Rusty, On Thu, May 29, 2014 at 04:56:41PM +0930, Rusty Russell wrote: > They don't make much difference: the easier fix is use gcc 4.8 > which drops stack required across virtio block's virtio_queue_rq > down to that kmalloc in virtio_ring from 528 to 392 bytes. > > Still, these (*lightly tested*) patches reduce to 432 bytes, > even for gcc 4.6.4. Posted here FYI. I am testing with below which was hack for Dave's idea so don't have a machine to test your patches until tomorrow. So, I will queue your patches into testing machine tomorrow morning. Thanks! diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f5c6635b806c..95f169e85dbe 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4241,10 +4241,13 @@ EXPORT_SYMBOL_GPL(yield_to); void __sched io_schedule(void) { struct rq *rq = raw_rq(); + struct blk_plug *plug = current->plug; delayacct_blkio_start(); atomic_inc(&rq->nr_iowait); - blk_flush_plug(current); + if (plug) + blk_flush_plug_list(plug, true); + current->in_iowait = 1; schedule(); current->in_iowait = 0; > > Cheers, > Rusty. > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org -- Kind regards, Minchan Kim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org