Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp323734imm; Tue, 31 Jul 2018 19:49:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpejZwBF1HoHPL52OPPKszpsrbpENdQmuMZgIPQc7hHB8/6c9rAtXV5dINqZhM7JznNOU5RF X-Received: by 2002:a62:5543:: with SMTP id j64-v6mr24680190pfb.188.1533091742960; Tue, 31 Jul 2018 19:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533091742; cv=none; d=google.com; s=arc-20160816; b=0riFrvQjDfhOkXBQPnWj6yXqR0kZ8al31AyWpipjPMOG5xpc/jIZpZgtPPKsF4/2eR Z1OYVqyq1v8KaNOzvctpPGlPT0mJd/x67b3OqZ6STdTnruhdP+dnD7zsqMArtCvZ8F3q 9jxtrauQ7Jmn/4OmjmduwUOpSP0Vhi8bYsJ5loAX5oT1dCPMwBUZa4rAbwcs09lUY1qO Uh/ZMVsN25PJz8lYskyey0GEwO7ZlCar1Wi5XXArOh4KoPpXSpYL6tK0x/ZtYLhCx2HM lFtiJ776E8NcZfmcZw/LOFIJmvAeCeBiRsG1DONZS6GTxD/bHUn2ZfgIxJYDPD5VUsgr DHDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=hGr5pNaI+H3B+TRP/6ZtKIBJBs4Zd7CCT9YKUOyu7IE=; b=Azxp/clf552LqJD0v7GRGPYk/NtZson+C2ckuMKLC7ln7z/Ua8o/O/eZFvkUkVSzrC Tfo1j93EYy5i3gvTxFX1ewxQoaHC/E/WT6R7WdnuOBZqzk0lnACsb4Ihr7FX9W/JP9aR LkJ9H2XVHxwiN8AodmOyk3kyt87qqYC+DtHoT0xIem5lafSJwDTmpryVtVKr9DCJb0kz Z/jzA9A2//qjeJFR4bTLBox0zAGYfqFy/9YHrYD0OmnWcxZ7vrQ5UxZ5vS0o60MIDiuG Yk6ANi951fQNW/Ks4V1lOfmaQEbDCT3ZC0hzeJcyd9EFKQogNLmoLb7kGpZ463OVN2Wt nIyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fxFUkBbW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24-v6si15516683pgx.314.2018.07.31.19.48.47; Tue, 31 Jul 2018 19:49:02 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=fxFUkBbW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbeHAEbS (ORCPT + 99 others); Wed, 1 Aug 2018 00:31:18 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:45154 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbeHAEbS (ORCPT ); Wed, 1 Aug 2018 00:31:18 -0400 Received: by mail-vk0-f66.google.com with SMTP id b78-v6so8567445vka.12 for ; Tue, 31 Jul 2018 19:48:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hGr5pNaI+H3B+TRP/6ZtKIBJBs4Zd7CCT9YKUOyu7IE=; b=fxFUkBbWkwYnecq/Q1Rgbv9fwcDIUFheGnZFDSPSWSWIoPV7I+y5OV82RBnXt4N0Ki 7FmaZOOT9sr98nm8d6Oa0F2iBzb62/i8yidMsEc26sJgE2CJD959smzTE4jXYfnlgNcJ bBqM/i/mQ+4JE16wV55kSlsZpoEEmkivGV1BEAGiE1FxKvnZLXjEZCwtDXJCK9JN6Wk/ /zXgIhk0HuaFuglaBR3MVl3+dfxINvaH1KMnVc+rtZOfgdoGd1YXThWxC0EE58ecUc7Q UBh7f/ZP0IYJl7Wxk0V2LQV7qkjXi9q2u17K/8U5KXmlbNkbbRWpLB110p6kPBs0h4lB YlIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hGr5pNaI+H3B+TRP/6ZtKIBJBs4Zd7CCT9YKUOyu7IE=; b=TraWtvrP5MG+sKNvpwWugQLE50pAMC+ERnrvot44Kj9mFWKhqPeE/y7VP+J6V+KByY riMzrtvtQUwqnEmPYQNWeoVGQFM3d06Y2VeUu/x08J8+vG2snTKZsW5qTyYyumsZYKAh h2suALM6Sf0/+utuAcJNzPVH9DzHR7qtR3nMYSFGDqKhW1YsULoNhJE7LKtDNVGgwHca 7WsB2Pa458tu30HkF9SCo2QNUbgO8iTP3CgDtYr6c2PQGznDmS8dc5CEcaoF0Pw2w0tb tgiOakbqtYoe5dgBPislN4vnTXsLW6JqfDuwbvKNdKIMdC4R2JKUVil/ZJwnccHjDu4x /JhQ== X-Gm-Message-State: AOUpUlFQMOGvq3cuc3GS6PoNBGyvJXyLW4S3JnzIprDjsPQRsnufp+a4 nZhiqIdzpnfJzvLYtCWFJVlOKyskgKCWOuWIVGz2ES0q X-Received: by 2002:a1f:ae96:: with SMTP id x144-v6mr15060414vke.130.1533091680512; Tue, 31 Jul 2018 19:48:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:959:0:0:0:0:0 with HTTP; Tue, 31 Jul 2018 19:48:00 -0700 (PDT) In-Reply-To: <20180614073153.GB9371@dhcp22.suse.cz> References: <1528790608-19557-1-git-send-email-jing.xia@unisoc.com> <20180612212007.GA22717@redhat.com> <20180614073153.GB9371@dhcp22.suse.cz> From: jing xia Date: Wed, 1 Aug 2018 10:48:00 +0800 Message-ID: Subject: Re: dm bufio: Reduce dm_bufio_lock contention To: Michal Hocko Cc: Mikulas Patocka , Mike Snitzer , agk@redhat.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We reproduced this issue again and found out the root cause. dm_bufio_prefetch() with dm_bufio_lock enters the direct reclaim and takes a long time to do the soft_limit_reclaim, because of the huge number of memory excess of the memcg. Then, all the task who do shrink_slab() wait for dm_bufio_lock. Any suggestions for this?Thanks. On Thu, Jun 14, 2018 at 3:31 PM, Michal Hocko wrote: > On Thu 14-06-18 15:18:58, jing xia wrote: > [...] >> PID: 22920 TASK: ffffffc0120f1a00 CPU: 1 COMMAND: "kworker/u8:2" >> #0 [ffffffc0282af3d0] __switch_to at ffffff8008085e48 >> #1 [ffffffc0282af3f0] __schedule at ffffff8008850cc8 >> #2 [ffffffc0282af450] schedule at ffffff8008850f4c >> #3 [ffffffc0282af470] schedule_timeout at ffffff8008853a0c >> #4 [ffffffc0282af520] schedule_timeout_uninterruptible at ffffff8008853aa8 >> #5 [ffffffc0282af530] wait_iff_congested at ffffff8008181b40 > > This trace doesn't provide the full picture unfortunately. Waiting in > the direct reclaim means that the underlying bdi is congested. The real > question is why it doesn't flush IO in time. > >> #6 [ffffffc0282af5b0] shrink_inactive_list at ffffff8008177c80 >> #7 [ffffffc0282af680] shrink_lruvec at ffffff8008178510 >> #8 [ffffffc0282af790] mem_cgroup_shrink_node_zone at ffffff80081793bc >> #9 [ffffffc0282af840] mem_cgroup_soft_limit_reclaim at ffffff80081b6040 >> #10 [ffffffc0282af8f0] do_try_to_free_pages at ffffff8008178b6c >> #11 [ffffffc0282af990] try_to_free_pages at ffffff8008178f3c >> #12 [ffffffc0282afa30] __perform_reclaim at ffffff8008169130 >> #13 [ffffffc0282afab0] __alloc_pages_nodemask at ffffff800816c9b8 >> #14 [ffffffc0282afbd0] __get_free_pages at ffffff800816cd6c >> #15 [ffffffc0282afbe0] alloc_buffer at ffffff8008591a94 >> #16 [ffffffc0282afc20] __bufio_new at ffffff8008592e94 >> #17 [ffffffc0282afc70] dm_bufio_prefetch at ffffff8008593198 >> #18 [ffffffc0282afd20] verity_prefetch_io at ffffff8008598384 >> #19 [ffffffc0282afd70] process_one_work at ffffff80080b5b3c >> #20 [ffffffc0282afdc0] worker_thread at ffffff80080b64fc >> #21 [ffffffc0282afe20] kthread at ffffff80080bae34 >> >> > Mikulas > > -- > Michal Hocko > SUSE Labs