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=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 56340C43603 for ; Wed, 18 Dec 2019 04:16:41 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 136852146E for ; Wed, 18 Dec 2019 04:16:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 136852146E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47d1sz1bQLzDqXY for ; Wed, 18 Dec 2019 15:16:39 +1100 (AEDT) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47d1cl6dt2zDqSM for ; Wed, 18 Dec 2019 15:05:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: by ozlabs.org (Postfix, from userid 1034) id 47d1cl32N3z9sSF; Wed, 18 Dec 2019 15:05:11 +1100 (AEDT) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: e352f576d345e5bf1fb62c8559851448a6c1d9cd In-Reply-To: <20191216103058.4958-1-david@redhat.com> To: David Hildenbrand , linux-kernel@vger.kernel.org From: Michael Ellerman Subject: Re: [PATCH v2] powerpc/pseries/cmm: fix managed page counts when migrating pages between zones Message-Id: <47d1cl32N3z9sSF@ozlabs.org> Date: Wed, 18 Dec 2019 15:05:11 +1100 (AEDT) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Fontana , Greg Kroah-Hartman , David Hildenbrand , linux-mm@kvack.org, Arun KS , Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Thomas Gleixner Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, 2019-12-16 at 10:30:58 UTC, David Hildenbrand wrote: > Commit 63341ab03706 (virtio-balloon: fix managed page counts when migrati= > ng > pages between zones) fixed a long existing BUG in the virtio-balloon > driver when pages would get migrated between zones. I did not try to > reproduce on powerpc, but looking at the code, the same should apply to > powerpc/cmm ever since it started using the balloon compaction > infrastructure (luckily just recently). > > In case we have to migrate a ballon page to a newpage of another zone, th= > e > managed page count of both zones is wrong. Paired with memory offlining > (which will adjust the managed page count), we can trigger kernel crashes > and all kinds of different symptoms. > > Fix it by properly adjusting the managed page count when migrating if > the zone changed. > > We'll temporarily modify the totalram page count. If this ever becomes a > problem, we can fine tune by providing helpers that don't touch > the totalram pages (e.g., adjust_zone_managed_page_count()). > > Fixes: fe030c9b85e6 ("powerpc/pseries/cmm: Implement balloon compaction") > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Andrew Morton > Cc: Richard Fontana > Cc: Greg Kroah-Hartman > Cc: Arun KS > Cc: Thomas Gleixner > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: David Hildenbrand Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/e352f576d345e5bf1fb62c8559851448a6c1d9cd cheers