From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id 7DF6E28070C for ; Tue, 22 Aug 2017 16:53:27 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id 83so331753691pgb.14 for ; Tue, 22 Aug 2017 13:53:27 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id g3si10118760plb.21.2017.08.22.13.53.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Aug 2017 13:53:26 -0700 (PDT) Date: Tue, 22 Aug 2017 22:53:16 +0200 From: Peter Zijlstra Subject: Re: [PATCH 1/2] sched/wait: Break up long wake list walk Message-ID: <20170822205316.GS32112@worktop.programming.kicks-ass.net> References: <37D7C6CF3E00A74B8858931C1DB2F07753787AE4@SHSMSX103.ccr.corp.intel.com> <20170818185455.qol3st2nynfa47yc@techsingularity.net> <20170821183234.kzennaaw2zt2rbwz@techsingularity.net> <37D7C6CF3E00A74B8858931C1DB2F07753788B58@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F0775378A24A@SHSMSX103.ccr.corp.intel.com> <37D7C6CF3E00A74B8858931C1DB2F0775378A377@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: "Liang, Kan" , Mel Gorman , Mel Gorman , "Kirill A. Shutemov" , Tim Chen , Ingo Molnar , Andi Kleen , Andrew Morton , Johannes Weiner , Jan Kara , linux-mm , Linux Kernel Mailing List On Tue, Aug 22, 2017 at 01:42:13PM -0700, Linus Torvalds wrote: > +void wait_on_page_bit_or_yield(struct page *page, int bit_nr) > +{ > + if (PageWaiters(page)) { > + yield(); > + return; > + } > + wait_on_page_bit(page, bit_nr); > +} So _the_ problem with yield() is when you hit this with a RT task it will busy spin and possibly not allow the task that actually has the lock to make progress at all. So ideally there'd be a timeout or other limit on the amount of yield(). This being bit-spinlocks leaves us very short on state to play with though :/ -- 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