From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17670C433E7 for ; Wed, 14 Oct 2020 17:57:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58F4222255 for ; Wed, 14 Oct 2020 17:57:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="l5qAYFFo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58F4222255 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5B9B66B005C; Wed, 14 Oct 2020 13:57:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58F976B0062; Wed, 14 Oct 2020 13:57:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 430926B0068; Wed, 14 Oct 2020 13:57:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 139636B005C for ; Wed, 14 Oct 2020 13:57:00 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 98B8D8249980 for ; Wed, 14 Oct 2020 17:56:59 +0000 (UTC) X-FDA: 77371286958.03.coal95_5a0cf852720d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 70BB028A4EA for ; Wed, 14 Oct 2020 17:56:59 +0000 (UTC) X-HE-Tag: coal95_5a0cf852720d X-Filterd-Recvd-Size: 4491 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Wed, 14 Oct 2020 17:56:58 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id h24so6063841ejg.9 for ; Wed, 14 Oct 2020 10:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fobYHYztRcy10+w7hd26W0suLfD59emOzXajN5Y0auM=; b=l5qAYFFo156/B4XdJzWOPtqmTKHvR21ZXv4iLyfo+HG40YsXJBPAtguQUVprmKS0Uk iAdgDi8lazMkjLTNUrZSekMm2NGvfyI0/DZQynclYFzHJEk3Jl4OyjDMzMqm8ZFc/Y9j M9Quvn93u9tKU32SwMwM/CjONBu3UgjSQE2gQ8lSLGhP8iIlMc6RH0rPCcQgVZwSLglS sL9EXXdpE9liaE9EuvvVKvoJkCNNmLiSKJ0MkPD81t6/7V6rQPejS/ylpIzX7xw8FDQv 9UfXp+SvbiPh77GrrJQkMU4Z/dI6T9UMdnrLh+mH70OW0zPvUCqBdrbH934qkWyP/Ffe 1YzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fobYHYztRcy10+w7hd26W0suLfD59emOzXajN5Y0auM=; b=KjMFTAv8Z/d/b4Pjm/+x7R/2SWB4EHKp8ay/+/SO7qEu286m3wGo/80C7CA5h0/d1g A4JRrMZ0ySF9RZXc0+PwzmkTrMZ6gvSd99WqpaxExvhnE0QE7ykjYEz5p1OmMDFi5AVD aFDZXSnBa9cwvVPZiS+TwT8EinD1229Sq10G/7ZRRJf1JokBJDRqbU1zosFbSEeR4RYP svr04Toj02KdltNSwIZ6W1SHoLEkm35+XwvWw+4LHO0/etZCrJqHOVE45DI4U2ldvmqj ly3dNI5jFfiNHCEJuA8UMLWbnPB89g2HLYvV4x8x8ZaD5//R9wpimXxVojchDms8Osu3 H+1w== X-Gm-Message-State: AOAM533dykss1j3xoQIc53kfNY+Bfdeqcf7wSLATDjGDdAmeFG7J3mtg YJr91WDQL/Q2s4ls3WP3+XgzKZOv3U3k4P1bpvX54w== X-Google-Smtp-Source: ABdhPJz57leuWYSHMLWqjo3wmE7CyGtwCqN0+eOMfe66uls8dAySNWCcPupwtppCZV63MUx8CtoBv7g1czawS9miIPg= X-Received: by 2002:a17:906:400b:: with SMTP id v11mr176114ejj.421.1602698217405; Wed, 14 Oct 2020 10:56:57 -0700 (PDT) MIME-Version: 1.0 References: <563d1eef-b780-835a-ebf0-88ae111b20c2@redhat.com> In-Reply-To: <563d1eef-b780-835a-ebf0-88ae111b20c2@redhat.com> From: Mina Almasry Date: Wed, 14 Oct 2020 10:56:46 -0700 Message-ID: Subject: Re: cgroup and FALLOC_FL_PUNCH_HOLE: WARNING: CPU: 13 PID: 2438 at mm/page_counter.c:57 page_counter_uncharge+0x4b/0x5 To: David Hildenbrand Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Michal Privoznik , "Michael S. Tsirkin" , Michal Hocko , Muchun Song , "Aneesh Kumar K.V" , Tejun Heo Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 14, 2020 at 9:15 AM David Hildenbrand wrote: > > On 14.10.20 17:22, David Hildenbrand wrote: > > Hi everybody, > > > > Michal Privoznik played with "free page reporting" in QEMU/virtio-balloon > > with hugetlbfs and reported that this results in [1] > > > > 1. WARNING: CPU: 13 PID: 2438 at mm/page_counter.c:57 page_counter_uncharge+0x4b/0x5 > > > > 2. Any hugetlbfs allocations failing. (I assume because some accounting is wrong) > > > > > > QEMU with free page hinting uses fallocate(FALLOC_FL_PUNCH_HOLE) > > to discard pages that are reported as free by a VM. The reporting > > granularity is in pageblock granularity. So when the guest reports > > 2M chunks, we fallocate(FALLOC_FL_PUNCH_HOLE) one huge page in QEMU. > > > > I was also able to reproduce (also with virtio-mem, which similarly > > uses fallocate(FALLOC_FL_PUNCH_HOLE)) on latest v5.9 > > (and on v5.7.X from F32). > > > > Looks like something with fallocate(FALLOC_FL_PUNCH_HOLE) accounting > > is broken with cgroups. I did *not* try without cgroups yet. > > > > Any ideas? Hi David, I may be able to dig in and take a look. How do I reproduce this though? I just fallocate(FALLOC_FL_PUNCH_HOLE) one 2MB page in a hugetlb region? > > Just tried without the hugetlb controller, seems to work just fine. > > I'd like to note that > - The controller was not activated > - I had to compile the hugetlb controller out to make it work. > > -- > Thanks, > > David / dhildenb >