Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751571AbdHWXaz (ORCPT ); Wed, 23 Aug 2017 19:30:55 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:35392 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbdHWXax (ORCPT ); Wed, 23 Aug 2017 19:30:53 -0400 MIME-Version: 1.0 In-Reply-To: References: <37D7C6CF3E00A74B8858931C1DB2F077537879BB@SHSMSX103.ccr.corp.intel.com> <20170818144622.oabozle26hasg5yo@techsingularity.net> <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> <37D7C6CF3E00A74B8858931C1DB2F0775378A8AB@SHSMSX103.ccr.corp.intel.com> <6e8b81de-e985-9222-29c5-594c6849c351@linux.intel.com> From: Linus Torvalds Date: Wed, 23 Aug 2017 16:30:51 -0700 X-Google-Sender-Auth: 5WrVoyVamAGUJ7yszu4_9lpyxC0 Message-ID: Subject: Re: [PATCH 1/2] sched/wait: Break up long wake list walk To: Tim Chen Cc: "Liang, Kan" , Mel Gorman , Mel Gorman , "Kirill A. Shutemov" , Peter Zijlstra , Ingo Molnar , Andi Kleen , Andrew Morton , Johannes Weiner , Jan Kara , linux-mm , Linux Kernel Mailing List Content-Type: multipart/mixed; boundary="001a11c1691e4fd90e0557741aa4" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8295 Lines: 137 --001a11c1691e4fd90e0557741aa4 Content-Type: text/plain; charset="UTF-8" On Wed, Aug 23, 2017 at 11:17 AM, Linus Torvalds wrote: > On Wed, Aug 23, 2017 at 8:58 AM, Tim Chen wrote: >> >> Will you still consider the original patch as a fail safe mechanism? > > I don't think we have much choice, although I would *really* want to > get this root-caused rather than just papering over the symptoms. Oh well. Apparently we're not making progress on that, so I looked at the patch again. Can we fix it up a bit? In particular, the "bookmark_wake_function()" thing added no value, and definitely shouldn't have been exported. Just use NULL instead. And the WAITQUEUE_WALK_BREAK_CNT thing should be internal to __wake_up_common(), not in some common header file. Again, there's no value in exporting it to anybody else. And doing if (curr->flags & WQ_FLAG_BOOKMARK) looks odd, when we just did unsigned flags = curr->flags; one line earlier, so that can be just simplified. So can you test that simplified version of the patch? I'm attaching my suggested edited patch, but you may just want to do those changes directly to your tree instead. Hmm? Linus --001a11c1691e4fd90e0557741aa4 Content-Type: text/plain; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j6pnkae10 IGluY2x1ZGUvbGludXgvd2FpdC5oIHwgIDEgKwoga2VybmVsL3NjaGVkL3dhaXQuYyAgfCA3NCAr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKystLS0tLS0tLS0tCiAyIGZp bGVzIGNoYW5nZWQsIDYxIGluc2VydGlvbnMoKyksIDE0IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdp dCBhL2luY2x1ZGUvbGludXgvd2FpdC5oIGIvaW5jbHVkZS9saW51eC93YWl0LmgKaW5kZXggZGMx OTg4MGMwMmY1Li43ODQwMWVmMDJkMjkgMTAwNjQ0Ci0tLSBhL2luY2x1ZGUvbGludXgvd2FpdC5o CisrKyBiL2luY2x1ZGUvbGludXgvd2FpdC5oCkBAIC0xOCw2ICsxOCw3IEBAIGludCBkZWZhdWx0 X3dha2VfZnVuY3Rpb24oc3RydWN0IHdhaXRfcXVldWVfZW50cnkgKndxX2VudHJ5LCB1bnNpZ25l ZCBtb2RlLC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