Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp752639rwb; Wed, 28 Sep 2022 08:40:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4G1aVd7w5gUII1qu/Bhr445XhCu5mXC3Zd9sMXbigLTCnledfv8e3leTbA1Wb5rUhJnBt6 X-Received: by 2002:a17:906:3a15:b0:73d:80bf:542c with SMTP id z21-20020a1709063a1500b0073d80bf542cmr28381801eje.633.1664379658199; Wed, 28 Sep 2022 08:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664379658; cv=none; d=google.com; s=arc-20160816; b=tJmB2X0k9ZZFa9JjrjM0CcOXRjPhUMnld9DLzFk5sHrY6F2bDG/TesVzstgDrVwukH NAbHHdFzaNeG09cBGC1abA+yjCSOXdD2spqvbrpkcBiXIe7YWQVqhROzo2dk52XQXKaN GARoMMrvidBlU7KoQBUaa4v+D/Aq/XP24kHdf+FqiSuqBiC15f4SbcnSUtBMvZzTQzzc aUk3nnt40uFxYbMO+BEcNQbkx6CkkYLui6MDRXLjxWJWSXKHoCSetM+RVdVlCV9HlfPp SDzFQqmo6g/t4yZLOjMwKVDV2bHWu+pIcguD1hwtkx7wYTUBxRQ9UTqZTpXlqlarQaiu Ompw== 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=45h6jBSLrKRgv8GqveYuR0XNqAwOaqvbHIMgSH3kRfc=; b=P6CwIe73kub0icPJ94GdNaf18TMQqVvthK0QLKqvqpN1yJ3m3yQ7epbJf8vNlnbe2T EtA8J72f2aUX5Yyr1FYSZfWDbwqnRNbgN/TJuxwCCJKH2+IZzqlEobS/cm/LsaXNvurI LZhioiyZY8E3LKaEVlHjtzd5gtwA9DgYcLN6u9IRrjaMGJIIhSTaUqY0bi1DrQCsryKl I5M0uSmNwRE/oheDM939cKcmJPBeLO0amABVnZIomVGUfw7aVYGL8+5lCLVOwPgHbkMd FAhlkCrAxRklldjoBlLviXMFERNhWYSz5Q0fMhQmKW0AYV6z2ep/95+qA2xUfZtO8Cpr 0Agg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OWF2hHMY; 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 f22-20020a056402161600b0045730f30afesi2710227edv.362.2022.09.28.08.40.32; Wed, 28 Sep 2022 08:40:58 -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=OWF2hHMY; 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 S234590AbiI1PJW (ORCPT + 99 others); Wed, 28 Sep 2022 11:09:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234614AbiI1PJU (ORCPT ); Wed, 28 Sep 2022 11:09:20 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCD3D9C2FC for ; Wed, 28 Sep 2022 08:09:13 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so2677355pjq.3 for ; Wed, 28 Sep 2022 08:09:13 -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=45h6jBSLrKRgv8GqveYuR0XNqAwOaqvbHIMgSH3kRfc=; b=OWF2hHMYcL2y3Klh2IeJVHtIBJTrP2wcwuXoRK1g0n8xP2eCucKlBbgRujeIQtsuhI ftL9O1rd6ph/Ca94aGCNKl8I73e3svcFZFDhITk/8LZM8WleC9+zmszKjyUe68LmGTsC lvWwhYzXiQTcH7Am18CUTSTqF8G/O+moFsNzlS/ymy+y2ujzkVpMIHNzOwwkdnIDxdVr 9AQdTUMOqgQjc1Lsz1wYYUDPtqV3PosuBGetl9s06CNz9wEuSJ9uDrNxvsIJw4RxMpQ0 0D7Dl+mGXAv6lrvDU9fQodILq4kCQ3s8JI+bk57z3pFglxGH9IDHwjfKU40zNT5//mP3 7brA== 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=45h6jBSLrKRgv8GqveYuR0XNqAwOaqvbHIMgSH3kRfc=; b=qVS0xXGXk8YNHIE4Pqp6fmDJyNjH6cVdf0FHkCqZlZ0YZfnA+GpZubYX6zTa1kTPiM kc7uM9PL5yGYK2FGXWlezRlGddJZk5eU6mBt+I4LgQ0tY2EFAw5xTSg0fnYvr/dyXPhR K32o4pg1eoVHMGsEL9HJDElbtzf9XIuG+59Jmwawc/R9fh/qBqTUipLUmGcSQ5/XjNyp UdA4CrTDSM9YIlWrtMsx/cX6uRNqY5FKo1qq89o7WB5/rkyPRz6d+pPFaxLITA9eDOto Kmg9hLb1zDbVDRxoJt4qPRdY2gszvFa5AGHXGOkfrlUsfRWhCBXe5s7cMWIEjpVFWhuW 5wqQ== X-Gm-Message-State: ACrzQf2hJcRXj5nLYC4zz6hH0p58I7T2s2A0J/uCR4DiGgOzmpqidL81 /0S1Qk/VjyL6VMOycXYUEuw= X-Received: by 2002:a17:902:bd02:b0:178:1a1c:889 with SMTP id p2-20020a170902bd0200b001781a1c0889mr253524pls.107.1664377752359; Wed, 28 Sep 2022 08:09:12 -0700 (PDT) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id f12-20020aa7968c000000b0055a5a3bda9asm4015403pfk.109.2022.09.28.08.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 08:09:11 -0700 (PDT) Date: Thu, 29 Sep 2022 00:09:05 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Joel Fernandes Cc: Hugh Dickins , Matthew Wilcox , Vlastimil Babka , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org 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 Wed, Sep 28, 2022 at 01:48:46PM +0000, Joel Fernandes wrote: > On Wed, Sep 28, 2022 at 02:49:02PM +0900, Hyeonggon Yoo wrote: > > 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]) > > Yeah definitely don't like this option as patches are out that depend on > this (not yet merged though). :-) Yeah, better to avoid that. > > 2. make __PageMovable() to use true page flag, with approach [2]) > > What are the drawbacks of making it a true flag? We don't have free bit in page flags unless we free one ;) > thanks, > > - Joel > > [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, Hyeonggon