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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4359C04A95 for ; Wed, 28 Sep 2022 05:49:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B64CC8E0121; Wed, 28 Sep 2022 01:49:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B13D48E0120; Wed, 28 Sep 2022 01:49:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B4C78E0121; Wed, 28 Sep 2022 01:49:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 87F308E0120 for ; Wed, 28 Sep 2022 01:49:11 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 579ADC0E13 for ; Wed, 28 Sep 2022 05:49:11 +0000 (UTC) X-FDA: 79960416102.17.47ED716 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by imf02.hostedemail.com (Postfix) with ESMTP id DD70E80005 for ; Wed, 28 Sep 2022 05:49:10 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so921298pjq.3 for ; Tue, 27 Sep 2022 22:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=KTIrhAnCo7Q8nBsj9dKt8KXzxa7ebHjNhFw7IocgNC0=; b=iCHf+be3FtlT33TDk1Et/B/ZefVpMlI2VNofVOlyS5BGBvsXRrfYHxNkfRrT3nUkmT kq1YNXVP1sdW4u1ehTVVYql9vzl/7bp9D/WrfPFyHZQRZtlXcKAjxvpsJhVzmjndU8AP yoRAcTYmIgRwonvHV4ibixDUOgeCHXuHugLdJXrjvfmrHyrKsgsbhDsZpV56Kf/NUEMw o0eJ18A6D5+qNBC11knWhW7C60lzX5HUcHub+RGZM7+wq57vyQi4mPM19GlEcQo+9Bq0 ic3ndpkDHwA7RpRfuWUmjt4kFRZ3W+UZ4+EnszHJw2mmDO6+XNh/J6cE5MrY1di/FfUl Tk9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=KTIrhAnCo7Q8nBsj9dKt8KXzxa7ebHjNhFw7IocgNC0=; b=jRVJC6mty1/E+PfDxI3oYnSPfz63LWv4m7S2wh+JSvjoRIPRupvEHIM3JP40glMKyD rCDbu30wmYeq4DL5mPcdGYgssKp5UYkKHZWMmtl2DGIWx10M5/k9AQ3x9H3aiMafzGpv 9KaTOMzxryIUfwmshY8VsArKFrVAVLAs4vw6+v/dHQD2Mjc5A1haddVg5DD+Xd/Y8sCS 6NUloP8aW7aojNIyFgIlnt8TTZx5KcX1n/jO1reuky3EzyWyP0BJSprAAfGpN7bzkkcR Ne84l3Q0nhfsR6+ScgLnHrSH3TZEMmv6a7RsaDxAIEY2CDH/mKXUWUB8g0S+ieqHCzvi LI/A== X-Gm-Message-State: ACrzQf2r80QeMzxIlTLBaFDWRPss/u2zoIxd3HJH68bIu+f+/FL4tfOO LlHUjO/oX2DtMJbJc59tucE= X-Google-Smtp-Source: AMsMyM4+FU/AHFYfnQDb1VzBw6Qffz6mEv1lxbPXq04zkQ43fApUIOfbAFjZbVWrRRa0picHWIW5tg== X-Received: by 2002:a17:90b:4a89:b0:202:d56e:e202 with SMTP id lp9-20020a17090b4a8900b00202d56ee202mr8390750pjb.22.1664344149718; Tue, 27 Sep 2022 22:49:09 -0700 (PDT) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id y8-20020aa79ae8000000b005364e0ec330sm2831387pfp.59.2022.09.27.22.49.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 22:49:08 -0700 (PDT) Date: Wed, 28 Sep 2022 14:49:02 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Hugh Dickins Cc: Matthew Wilcox , Vlastimil Babka , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Joel Fernandes Subject: Re: amusing SLUB compaction bug when CC_OPTIMIZE_FOR_SIZE Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664344151; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KTIrhAnCo7Q8nBsj9dKt8KXzxa7ebHjNhFw7IocgNC0=; b=kzsdAg68N3dtrXylz7eaBXIaQniR88gpnd0t8zb+6Xhd9kJ8wXcxaRrV5Kvo16nfGElvw1 tCVWKf456uL/eWxaFf6/ZC+eoQWmA+vzX7cNXnUm+iDdxFb1bAWwY1E0VCMhI3xucIgcsu FPM6fFjJfWZpGywSYU4zqaAoKEmERdo= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iCHf+be3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664344151; a=rsa-sha256; cv=none; b=qefPmKnfmj202QTxdMUzImNHeYtH+o+0G3ZC3vmS4i1FO02A5eqWaCJmmXKqI61PKRd7PI Q91RZd+wxkY9oEhpHpNG6YfYaJUurXsyd6WVjNRbhMKyPjaTizwCfoYHX3I7zKxtE4/chp WtxfHpgz2SvyYh+lNU5WKLMzqGlk77c= Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iCHf+be3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf02.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.43 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com X-Rspamd-Server: rspam02 X-Stat-Signature: o4kakjksqbmek453p5bham3rykz689mt X-Rspamd-Queue-Id: DD70E80005 X-Rspam-User: X-HE-Tag: 1664344150-458198 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 Tue, Sep 27, 2022 at 10:16:35PM -0700, Hugh Dickins wrote: > It's a bug in linux-next, but taking me too long to identify which > commit is "to blame", so let me throw it over to you without more > delay: I think __PageMovable() now needs to check !PageSlab(). > > I had made a small experimental change somewhere, rebuilt and rebooted, > was not surprised to crash once swapping and compaction came in, > but was surprised to find the crash in isolate_movable_page(), > called by compaction's isolate_migratepages_block(). > > page->mapping was ffffffff811303aa, which qualifies as __PageMovable(), > which expects struct movable_operations at page->mapping minus low bits. > But ffffffff811303aa was the address of SLUB's rcu_free_slab(): I have > CONFIG_CC_OPTIMIZE_FOR_SIZE=y, so function addresses may have low bits set. > > Over to you! Thanks, > Hugh Wow, didn't expect this. Thank you for report! That should be due to commit 65505d1f2338e7 ("mm/sl[au]b: rearrange struct slab fields to allow larger rcu_head") as now rcu_head can use some bits that shares with mapping. Hmm IMO we have two choices... 1. simply drop the commit as it's only for debugging (RCU folks may not like [1]) 2. make __PageMovable() to use true page flag, with approach [2]) [1] https://lore.kernel.org/all/85afd876-d8bb-0804-b2c5-48ed3055e702@joelfernandes.org/ [2] https://lore.kernel.org/linux-mm/20220919125708.276864-1-42.hyeyoo@gmail.com/ Thanks! -- Thanks, Hyeonggon