Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp434078imu; Thu, 3 Jan 2019 00:12:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ovqrL4gbbWrtoY/q0hzR31zY/Z4O+rZLEt4pKUB7A/1erzfnOqXpH2nA7TYOdkofpdhXp X-Received: by 2002:a63:d70e:: with SMTP id d14mr16322843pgg.159.1546503178732; Thu, 03 Jan 2019 00:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546503178; cv=none; d=google.com; s=arc-20160816; b=QrjX/2cM0IHYtKxUkFRye5djedkCF2xlcfDr7IyPtSxN59oOo1Ic6niSJQR8mt7VxG gHeUrwSwP36aib9CCPrVfzKvMHbGRUbSuiEGL/v268d445gQduzrNLsVbGFI5OjRQ5Bi P1gdGZuQgCY2b9iRBL83gGhUasaG7F/N6D/sJHLdH8iPYzqMV9QKmLSE0hgD2pMc29lv QBzaeTckqSbAGVKaa2E/ixD+ZA11NLjJHa+9Rv9j75I+u6YDPIqPgJsPl6yoINVW4PYX TRjCHVx0RTOOtQeU9Umr4mq0Vd9tkWgZ9Ih+kG7XiraKi38bcNBw17EiPaMrjESbS9Et ZG2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=fC6zZwwkZFDhotViCDXx6OKAdwNRRqxuNgHWv0kuoD4=; b=Yzfn9yBFnbNRIoa2O3tO5NItMLLSErFadWBwbi1nUl6PxkVEIyH2JYsfstt9FQ2av8 bE85/NeCEVjPLQryShyGmcEddCuV4bNjF1PP9LtIKlaTYcfe2G1CBZZnQ+H7pyX2Sf+G PA1fX3u/ZOToZEDI45GlLwpREdrPhECGLQP80gnDP7oTv0L1PDo9rzmFkW4xPXF1c1gR yfGNF+GHYFxk82f+FYxSFt46wX5BO0ik/15pz6uEeQoLTtGd9ZMeFs21PaOsbzWevuIt 7L08m8DjfdRs7TptOoPpQ1RgxrO76z0zs+IswHsib6bSW7oYgPWY4Hat/n2MhgyEfIVb 5ABQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=qggCaO0x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2si51045846pgo.544.2019.01.03.00.12.22; Thu, 03 Jan 2019 00:12:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=qggCaO0x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728630AbfACD1o (ORCPT + 99 others); Wed, 2 Jan 2019 22:27:44 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:35797 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbfACD1o (ORCPT ); Wed, 2 Jan 2019 22:27:44 -0500 Received: by mail-qt1-f193.google.com with SMTP id v11so35665075qtc.2 for ; Wed, 02 Jan 2019 19:27:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fC6zZwwkZFDhotViCDXx6OKAdwNRRqxuNgHWv0kuoD4=; b=qggCaO0xleTaFzqcx8RrXZZAhj9x3MS3amTq7vuT9//SwTU83ANwIJ917h1asxUVal rIGnKI7r/L+FJXQLpozgc88uDd7t6vomEVmKQ+Fr0Ies7un5gwNUxtTt5HqfGOhk0Tsg H2nCdK9qy5sTDZ8Lk1c5uwaAY07MbzIFRPKIGf/kNuz1EyblqHNoqq307JENEhSk1Uen Rwhr9F86rn4aRpedMfu8yYMQs4R/7Hg0s/qCPX172lbSpyTpImTejmOUx3GYsJbsoRwk CWuRADcrRV+K5OQwEkub+OK/gcUW/w5XKObduJiEwz3rWXTZizzA8C+RWJl2yJGzQ2/h 0+Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fC6zZwwkZFDhotViCDXx6OKAdwNRRqxuNgHWv0kuoD4=; b=K+ABettODLA6eXfrnpxDhKTJEAGvbYqFKxzCdAsyeS1yP6OqyJalHJXxv/oO6AmBOD gsB4d3GNk5JWDFiEEA9MuvDFnulGLVvAT12jXySdMFhM6TNVM3EPJU/IqJAlUOV57qjh sa1KYlXbd85Jcnxj8mGHKovsMY8WDtbpTDsSuV5orNcc2iuF8yfEYUfx2QPcDVY1si2b E1Lx5hUi1UzvUe9z66Rwojd4fUEi9ZatI82HIrw9kuxLkbDTOn4nRt68S/Z8XdYuR21e aVMMaScSbLTaWsHFbpamL5XQx18LsQzK/W/P6euQ1txrP/B2Np0veOidrjT41vDcIS+B BOkA== X-Gm-Message-State: AA+aEWZJMeeEPkz/bZG0Vit+hLulchSGNl/eDyhZb2aykIUGmyKyFBo9 bSe50Sw3H9b7lvuWSKB/3lPezA== X-Received: by 2002:ac8:5314:: with SMTP id t20mr43855892qtn.328.1546486063301; Wed, 02 Jan 2019 19:27:43 -0800 (PST) Received: from ovpn-120-55.rdu2.redhat.com (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id s24sm6283886qkl.48.2019.01.02.19.27.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jan 2019 19:27:42 -0800 (PST) Subject: Re: possible deadlock in __wake_up_common_lock To: Tetsuo Handa , Mel Gorman , Vlastimil Babka Cc: syzbot , aarcange@redhat.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux@dominikbrodowski.net, mhocko@suse.com, rientjes@google.com, syzkaller-bugs@googlegroups.com, xieyisheng1@huawei.com, zhongjiang@huawei.com, Peter Zijlstra , Ingo Molnar References: <000000000000f67ca2057e75bec3@google.com> <1194004c-f176-6253-a5fd-682472dccacc@suse.cz> <20190102180611.GE31517@techsingularity.net> <73c41960-e282-e2ec-4edd-788a1f49f06a@lca.pw> <530f88a1-3aa1-c36f-f487-7e5e33402fb0@I-love.SAKURA.ne.jp> From: Qian Cai Message-ID: Date: Wed, 2 Jan 2019 22:27:41 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <530f88a1-3aa1-c36f-f487-7e5e33402fb0@I-love.SAKURA.ne.jp> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/2/19 8:28 PM, Tetsuo Handa wrote: > On 2019/01/03 3:19, Qian Cai wrote: >> On 1/2/19 1:06 PM, Mel Gorman wrote: >> >>> While I recognise there is no test case available, how often does this >>> trigger in syzbot as it would be nice to have some confirmation any >>> patch is really fixing the problem. >> >> I think I did manage to trigger this every time running a mmap() workload >> causing swapping and a low-memory situation [1]. >> >> [1] >> https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/mem/oom/oom01.c > > wakeup_kswapd() is called because tlb_next_batch() is doing GFP_NOWAIT > allocation. But since tlb_next_batch() can tolerate allocation failure, > does below change in tlb_next_batch() help? > > #define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM) > > - batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); > + batch = (void *)__get_free_pages(__GFP_NOWARN, 0); No. In oom01 case, it is from, do_anonymous_page __alloc_zeroed_user_highpage alloc_page_vma(GFP_HIGHUSER ... GFP_HIGHUSER -> GFP_USER -> __GFP_RECLAIM -> ___GFP_KSWAPD_RECLAIM Then, it has this new code in steal_suitable_fallback() via 1c30844d2df (mm: reclaim small amounts of memory when an external fragmentation event occurs) /* * Boost watermarks to increase reclaim pressure to reduce * the likelihood of future fallbacks. Wake kswapd now as * the node may be balanced overall and kswapd will not * wake naturally. */ boost_watermark(zone); if (alloc_flags & ALLOC_KSWAPD) wakeup_kswapd(zone, 0, 0, zone_idx(zone));