Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1745098ybh; Thu, 23 Jul 2020 17:08:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI7Na3Ls9BRjRo3asXkF5+cieXEFRCrXDSJVzJ6NVBMCruuPbkKFlCOdpO4YgYfIqu2tLL X-Received: by 2002:a17:906:d7b1:: with SMTP id pk17mr644422ejb.554.1595549320755; Thu, 23 Jul 2020 17:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595549320; cv=none; d=google.com; s=arc-20160816; b=MrMecyY6E5jJxSRfsM/f6vIQgX4U3hi7pxzIyesoETMXU7ufUZNnrMHbsX+iMvjJdO Wqj9WxuqvQEup4V0A6He7AxR6tSy0YYOe3kjPiSBJ1ahnNATWcJhjh/1lkUyH1P8AK2X ccxmh1Iy3rz60QTQHCiGiKancYYUYd4aP/Is9cF1mAQORE5S6kHl6XHfm/Wn6EMFVNz9 ubx2mxB1T+HdQtGt7aVcFNykSYgOgsc2IXNIiUtDwJDgigbrusqnsjKvgNDHrxwPcQAQ 2dQ8GgRiEUez+InG55xoRkugj7DCvvHRZhTCspFNPyrHXUiZ7ZJxq8g/3YF/bbTbtQ0Z RDVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=qBujHwaGJCw1P6JdNgGCLPuEf10oBiRobzBG3EaDAig=; b=NtJGMeeCITfPGKddwAihUQXtVeXCW0YYjAORmoid8p2d2DcrMiMSM4ABoYf4vAY/0l UUC+QwiZUC09zscSo3CBa+fvEMXo6LIlLKeyUfQJVjUl2Q90ZuGecr+BW65LNAUMAOg6 QD8Eupso5KW51Tm6KnmPqpNUkJMahpS8sT0J2Y6f2TSkCWz1z8k20T+G3VfQ9QiQgqFa SlJXPbw9nLStrJBV8wK0WqFp27GeOFWGXNcN+/z25yjMT2DsFiLUkD/EqaJ3drR841Ok SOXoas/yQPxSZdu0+JKOrM+Y+waa9+pWoj07FLP0FCewCrtQMPY8TIgnrw/bHFp0tqeg OvNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PXXNj3mX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si3011319eds.47.2020.07.23.17.08.17; Thu, 23 Jul 2020 17:08:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PXXNj3mX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728287AbgGXAHp (ORCPT + 99 others); Thu, 23 Jul 2020 20:07:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728230AbgGXAHp (ORCPT ); Thu, 23 Jul 2020 20:07:45 -0400 Received: from mail-oo1-xc43.google.com (mail-oo1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D78FC0619D3 for ; Thu, 23 Jul 2020 17:07:45 -0700 (PDT) Received: by mail-oo1-xc43.google.com with SMTP id t12so1473536ooc.10 for ; Thu, 23 Jul 2020 17:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=qBujHwaGJCw1P6JdNgGCLPuEf10oBiRobzBG3EaDAig=; b=PXXNj3mXqSvNjasml6R5Hi5qDcF7fW14Ck6nRxwkEqfHid/XLbbxiYx3nnsR0TSmCf 38Y9QVxWK7AuUOCYWZBPQL9VwahHXVfU55bea8yUqtxyClD6JlqM4EDQ3Miz444HpFwe ZAR15l3fXJsKaUdfCXB5aJy33D2KgQNzuY7excItMx3FSeDGKOVfgaz846WtFVCQxA7j oQgFEikrqDiXt9pITWrgzDTNxhG5Sjxwl9XSHjXuG89XRtynZJUASmrtA0kZul+71ONd IFuwYXITdNUHfo10M5eCrihO/dZL5Z1Trw4HztTp5TDEa5P3wm/1cKS99gEm8y7PnRkt z2rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=qBujHwaGJCw1P6JdNgGCLPuEf10oBiRobzBG3EaDAig=; b=t1qxNcSqqhUcL9ZhqycMsG2prQhQ+PbjvMkN0434unMpaJDDynr/sEmIBUAwwanHPS DF+JM3Lz0WLQoolWuiIdH4wY20GncTR3//77YvTw77yMC5gEzUv6oK52Cl/ny1BzNaT6 Ay7u/VJei4FB+96JfqgGOgtoU1o2AnT4I76cbGiS5on1SRBiqWfvX9CM6TNL2H763sdM ZI2JaGIfHNuuX/tduOdvvDQZIKOnL91SNeDlo6L85aoUr8mxQXShBLzEMUk4Q9JvoKIn YZnIMz49gChjxskriv+dqvlRtKnOTHRY758dkk/NCGu4RL5wPQXsqN33885ZYyJp1Wik c0uA== X-Gm-Message-State: AOAM533U6tidMg63b383gXp4Eb826Q1q0xERl3XtOWt2qgIQTiPrvTwb 2ro0ku9sf0cmApIF165sAYP/6Q== X-Received: by 2002:a4a:e8da:: with SMTP id h26mr6946228ooe.59.1595549264015; Thu, 23 Jul 2020 17:07:44 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id x138sm1016689oif.5.2020.07.23.17.07.41 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Thu, 23 Jul 2020 17:07:42 -0700 (PDT) Date: Thu, 23 Jul 2020 17:07:27 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Linus Torvalds cc: Hugh Dickins , Oleg Nesterov , Michal Hocko , Linux-MM , LKML , Andrew Morton , Tim Chen , Michal Hocko Subject: Re: [RFC PATCH] mm: silence soft lockups from unlock_page In-Reply-To: Message-ID: References: <20200721063258.17140-1-mhocko@kernel.org> <20200723124749.GA7428@redhat.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Jul 2020, Linus Torvalds wrote: > On Thu, Jul 23, 2020 at 4:11 PM Hugh Dickins wrote: > > On Thu, 23 Jul 2020, Linus Torvalds wrote: > > > > > > I'll send a new version after I actually test it. > > > > I'll give it a try when you're happy with it. > > Ok, what I described is what I've been running for a while now. But I > don't put much stress on my system with my normal workload, so.. > > > I did try yesterday's > > with my swapping loads on home machines (3 of 4 survived 16 hours), > > and with some google stresstests on work machines (0 of 10 survived). > > > > I've not spent long analyzing the crashes, all of them in or below > > __wake_up_common() called from __wake_up_locked_key_bookmark(): > > sometimes gets to run the curr->func() and crashes on something > > inside there (often list_del's lib/list_debug.c:53!), sometimes > > cannot get that far. Looks like the wait queue entries on the list > > were not entirely safe with that patch. > > Hmm. The bug Oleg pointed out should be pretty theoretical. But I > think the new approach with WQ_FLAG_WOKEN was much better anyway, > despite me missing that one spot in the first version of the patch. > > So here's two patches - the first one does that wake_page_function() > conversion, and the second one just does the memory ordering cleanup I > mentioned. > > I don't think the second one shouldn't matter on x86, but who knows. > > I don't enable list debugging, but I find list corruption surprising. > All of _that_ should be inside the page waiqueue lock, the only > unlocked part was the "list_empty_careful()" part. > > But I'll walk over my patch mentally one more time. Here's the current > version, anyway. Thanks, I'll start some tests going shortly. I do have to "port" these patches to a different kernel, and my first assumption on seeing crashes was that I'd screwed that up; but that seemed much less likely once the home test on top of v5.8-rc5 crashed in much the same way. The latter was not a list_del() crash, but on curr->func itself; but I take them all as just indicating that the wait queue entry can in rare cases be freed and reused. (And the amount of "port"ing was close to nil here: our trees did differ on an "unlikely" that one end had added or removed, plus I did start off by reverting two of my three patches. But perhaps I'm missing a subtle dependence on differences elsewhere in the tree.) I say that for full disclosure, so you don't wrack your brains too much, when it may still turn out to be a screwup on my part. Hugh