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 5F093C32771 for ; Wed, 28 Sep 2022 15:11:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9784B6B0072; Wed, 28 Sep 2022 11:11:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 927DF6B0073; Wed, 28 Sep 2022 11:11:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7EEF66B0074; Wed, 28 Sep 2022 11:11:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6C8996B0072 for ; Wed, 28 Sep 2022 11:11:08 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1EBA0C0DF7 for ; Wed, 28 Sep 2022 15:11:07 +0000 (UTC) X-FDA: 79961832174.22.F5233CE Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf04.hostedemail.com (Postfix) with ESMTP id 8B9044049C for ; Wed, 28 Sep 2022 15:09:13 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id e11-20020a17090a77cb00b00205edbfd646so2697173pjs.1 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=zC2kGG6VwkclGXlMi6h3MqQ8dLuK42oQOgEx/JUbPrlraF324dljJC9X4Qelr3091+ i2+YQRcfVYDbQTJ5Bed/ZmbSdrgK56OI9MPrxCuSgPNqxFKiBDVKuUq/RnM5cJuGRUxe F5rUONVPa51v0d+n310cE8/K1GWB3FQD7+zOU7FfYH8GFQqfi7Q1i+cUymcgtgUcd23D ESnV/XrM3LFcvrxWu8aA/QtKbQ6HJiyMAyqyM/XdWToMMJjpN+iyUakE/xkEBv+HxnoT L6CEVLV3gFLsror+6qmoGwWABH9zf2MUuE1OcCcPP4CzCVZIrvZwDmsoIDyTE98vfMlj 3zzg== X-Gm-Message-State: ACrzQf1QsLU8C6ss8a12XVw4+9Uayo5cMLbDav3Hxpbef0epeQumUTSl YpLFF8GzIwGMWarnVuH0sbs= X-Google-Smtp-Source: AMsMyM5KeEtk4K2u0R+xgn8vxplIG0zX+Xt0Kni9OYYb+MQGGGDnEtJvvONA3jsa2zADbiRg3AH4mQ== 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: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664377754; 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=45h6jBSLrKRgv8GqveYuR0XNqAwOaqvbHIMgSH3kRfc=; b=AdvksaSTqlnMu0OEg9AOws+jM3t5p5BjKS8CZ/CBWwhSHNA2cGldGa/W3eSxreOKLF+um+ 3Aw8GWD5KzvUuI3K+mvlL/H3gmpn+jZZK3htlSW2Z+pHRLelOq0//sOF6Jk88UknoQJpP5 gtddP1BMXLiP5xISVBobWnOLqAx9FxE= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OWF2hHMY; spf=pass (imf04.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664377754; a=rsa-sha256; cv=none; b=PjFwb1HZoaB6qcmIJG8MXYUzQ3ZTi2KjbQSASSKiIRB0CpVUQd+CPBPCyxp9uTD7jE6NCB J3ph95LbX7i0bd24LXqLrR7qRIi4LoX500KAt3wFPYWJvXE1mJzR6o8pHXjbuygvbiGvYx jRpAv1aezkGO3Pp7SJ+4R9vxjsPfUYE= Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=OWF2hHMY; spf=pass (imf04.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Stat-Signature: gdtgqduzye7x1f81xqms3mn3dty1qz7t X-Rspamd-Queue-Id: 8B9044049C X-Rspamd-Server: rspam08 X-HE-Tag: 1664377753-340298 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, 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