Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp85933rwb; Tue, 27 Sep 2022 23:07:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4vnmhOVcLSrHDYS52hgajZrf0+idE+xNBn1DSskb+Da0aW3P6WQw2C054K9wF7GCjUQML1 X-Received: by 2002:aa7:c849:0:b0:453:9543:6ef3 with SMTP id g9-20020aa7c849000000b0045395436ef3mr32012805edt.105.1664345264217; Tue, 27 Sep 2022 23:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664345264; cv=none; d=google.com; s=arc-20160816; b=ogatXrO+EnjyQ4fme04PU+1Pp/92EF2IQQHOPn/dRy0/hCrJJG2jEIq6HnA23/gHZl rPSrdwpPw2Vw+107/yLYTaeLHbZxNfyGa1IexFLqZpo8+mth4rWPWNToqyE8ENFhptPD VMhrNc+hkISvAr704kPRz8y33zksRb2rPQKvcnbWbk+AqOXuNIuyQW0MUu7wuMBJtQia mEp14mJmkyQ3f5GqRW1h4u6Hepa2Y9IK6hMSQs1Fe9Mn5CFzyMfhL5jNB5PCXOCvJRaz UPCGOkrY8z4hG9tZrbFx3eob+gitTDsFZmzYuWWXBO0YZUQq1dBj2eX83l+c1TMLz0f8 qoMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KTIrhAnCo7Q8nBsj9dKt8KXzxa7ebHjNhFw7IocgNC0=; b=VsQL4hSLNlwgPuLJiTvFNBHxjz+nGDs6+CJUYB+GBWtNK9AEaXhCDdRo5gsScWkgzc rQafTpgqqrQlg3ET1mdWOEWj1YXuAYZMc39JEzfDG+urbltHrF1suVQihK7VI6i7s9oC lPggTIE1EAiemV53zDfqK+HbfOZ8qyXEwONVZKoZRfnr2TfqBF4FSOYvQIzRKvSglBU8 evuReHyw9LxuOlo9IwVgCE7UjuQiZ16NuwFsbfqknDmfqGSfONrdJqG8lKo/RBFfR47A VTLw3QUXI3qK0TdwcS19mMcRExaIsSB/ViByfM7KQDGZLfOTwnKwfm/d2K1mcZ+nK+Cv VS+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iCHf+be3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a170906b18500b0073c194e9a01si3412995ejy.949.2022.09.27.23.06.53; Tue, 27 Sep 2022 23:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iCHf+be3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232380AbiI1FtN (ORCPT + 99 others); Wed, 28 Sep 2022 01:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbiI1FtL (ORCPT ); Wed, 28 Sep 2022 01:49:11 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46364106A3A for ; Tue, 27 Sep 2022 22:49:10 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id w20so10893460ply.12 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=NA1297m7MYdDPqHpcggnJn2td1yIIJlOYZK7EPPFaCLcPXhJtkVp5iNxsRPmvudt0G FNYfwmkux99ktwMR2nqmIvggR0CdKIWYBrBVeNuLRagv1XS1U+/lpbuI9Ioa2A6HVen5 7DOyA/ecZAbk3bxDGAzOWgqdKXcX557wPzWZxIqqjM9IQvJYJKIGs6GxwBblR3wIaZG+ 9m52FaCeRX6AOfTle9fGcIahjxjYw7kIQHRTscUN/XGtd96b75gb6eT2Ucxlf7FJY25A 3SjaHfUmVro+2hMhllfokDUSJ4ybempnkG4SBKpmjmd8sL/+wporZ5bQiMaX1/V4iBzL G3/g== X-Gm-Message-State: ACrzQf0UNlM9aEw+qCociBIh07c5doknb3lPW4JPSdWamf3wK8XoJK2H xQy5DR+R60uMI0iMTrPUT98= 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: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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