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 82FC8C2BD09 for ; Mon, 24 Jun 2024 19:50:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F422F6B0379; Mon, 24 Jun 2024 15:50:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF2236B037B; Mon, 24 Jun 2024 15:50:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D933F6B037C; Mon, 24 Jun 2024 15:50:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id BB68E6B0379 for ; Mon, 24 Jun 2024 15:50:52 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5D1AA812EA for ; Mon, 24 Jun 2024 19:50:52 +0000 (UTC) X-FDA: 82266825144.04.B4CF587 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id BADC9C000D for ; Mon, 24 Jun 2024 19:50:49 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DfVk7ryb; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719258631; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1HOmhYkqorxtw73lg/pG0orZL1FyfjnL9NoN4K798Og=; b=JSIDo+DNthqoZUrrWE8cbOD94/6QM2P+D2dd+MQUwGrd2kJGQt+fo/TuZrdQrr5+S9zJNX 3NqRRtwX4NLDrcrzGa7AexZShRle/nfu4U3xxQFOOuFPNlV2xrwDFieQyq1J+Du1S4m49y Ku4mXc7sRU0g15HwF1LAQCRII8KU2eM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=DfVk7ryb; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719258631; a=rsa-sha256; cv=none; b=YXSeV6CxpfJvpNdAmCpDWWsgeGDNaull9mK6uB07RUgeOMn3FVp+q2pOiKG0zc7MdTkWfF qXaZJS0Bj2O2Ax7aoPtJAuTgEvOnJ13Z66xbobWJCzi1XOVLPo1Uy5sFePC4BwP4Gj335Q Ho1VczajufOQ5k9Rpa8hyiqD4NuWt40= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=1HOmhYkqorxtw73lg/pG0orZL1FyfjnL9NoN4K798Og=; b=DfVk7rybxn+Cc8wqcCH/+tjnW7 WEsL9Bccp/JiwYUmuwjrkbC4Esa9isSp+GUVUE8MLHpF3hBD4q86WCPsxJPEn9yYtrxisP+41KOrD 0yOM9UcyfkldRSGfNj4JGDoJ8whIf+BJJzqTiWLwXNCt/xQc7s87t4IDb+ZpOI3SUpmQGrMavtOFc GoUMoO7LEzVlh5raAjEtPBz36cSNDbkTFE6RvsypfaUK15YZJuXFl8coFVVxjgDXTcSWKY//EyPJB pLJuLKyOlTXP8iTkVBMW3JEVO0+xLALfBF/KQguBBoRUUtJfriJRCf7PCfFAOduR9VE91+k0Asi4D BCqE4Vvg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLpi9-0000000AO9F-0rfX; Mon, 24 Jun 2024 19:50:45 +0000 Date: Mon, 24 Jun 2024 20:50:45 +0100 From: Matthew Wilcox To: Yosry Ahmed Cc: kernel test robot , Usama Arif , oe-lkp@lists.linux.dev, lkp@intel.com, Linux Memory Management List , Andrew Morton , Chengming Zhou , Nhat Pham , David Hildenbrand , "Huang, Ying" , Hugh Dickins , Johannes Weiner , Shakeel Butt , Andi Kleen , linux-kernel@vger.kernel.org Subject: Re: [linux-next:master] [mm] 0fa2857d23: WARNING:at_mm/page_alloc.c:#__alloc_pages_noprof Message-ID: References: <202406241651.963e3e78-oliver.sang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BADC9C000D X-Stat-Signature: 3ruukqguhyoawuertgg16m7y1bhgp6sb X-Rspam-User: X-HE-Tag: 1719258649-683647 X-HE-Meta: U2FsdGVkX1/Aedacid5j9bfVdOng60zHLfipKXxwoGAa4u5Q6jRvwLs/jLbBlyAtVaW0PqSOFyGHoy5+lQgt9W7imwCyIOyznjm3236FnNMxwiZpu61Iak+RQoW67SgWS8tUgaifpvEEu8PvOr/1B2P0VXHPmV4hy5xAY9yvomqrK7gM1W2es+TTBQeN6VpF6cQTeE+f+tdqkGbe1A7zzNwliqrzRBdlCRfYSloK9a4nB48qA6PGzYaMsiaqcC5mwyeqQLU49f+vz/vAHIPCgtQqqgRVtr0hWYGmNCQr7Zo+9Cld18boo976CROft/5lxQjeY36huAKm6NG6tZ4N5QC0PIW25f6thLf7bWCb9OEfgtvPYV3LN6T2z8J8TYwxHpSXI5Vebh3iJ/tk/e3hLFSoHY8VuyKbimzIMB6cmbz1gR/WkzpevCAi0onm+ug+Me9Dy/1yieRnRsCk6bYpoiCExpwhsujOaHWV8Pvb8KvTaO8x/hDrtbj9cwkt13iQR+NVo+K7y0mybAzVHICVH7BPG4m5FKip4rdrSzTPPQgZA+PSbLPsEVTQUaFYkNpgFrCB4Px5S+uwBoPUnLhubjTAeU4Xe0CwxqHrClzDhhM5TJ68iGrzHLQ4g5f8u8yvCRnb3YYrpREhODHCbLkPrI7jx3O9NhV/zVTyDOROqhLHbgNGLFDe5NTf+FbLcYNRN69LJejblSyQIzBv1iOduu47W2R6ml/4j6eVNWL8eWDImPIlo8hzfr912HBZn5xuM796iDMYb40wTGNXP5WLXXZqMyYVFSLWFZo+M4gAyCUbY0ckUPcAHe5Afd4Fhd4gQ0ojGHqI0FhidxGUWgE5IUnssOxog9KgKxQBKJqoqLXMqrSj+dl7Lww2l8HXs3tZ0ykgXzIS/LURXQ0MXK3oloUhS9hr5H2wNnBi1hR3t21bLFW6N4ILQTRozGIySuDDOnc71rt4ETWVO+uXmzT BBqDovUl 44XXNZSWABmAspEhI3GGqR3YIZeR9f5wuMsSqd2Un9d+So/U6J2PePD8dDpAnst9gc+uGJTJ5yLRG4Bho+EJHAxG9+Fd36h8MzCHEPfbODxdbfOXhzum/mpBGGZQOaav0snoKYPXtG1X7M5HzT9oicEPQfM4qn03+D7M3QpORhfMwupjRbvdiKQahVPxWpdJ93MxpHgH/iE3I4QGDD2W/jNIDj6iKja5bGtUN5arMTmTUIkSvZnXY4b82+m6l+rykoQWP1UfAqs1qu051hY3h9n2yN17ch0rI2VlG2QInF405u1NLJKIu/22v8TaJ/emZoJMTqbZD8wUTrFkU/oOk8fY1fg== 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: List-Subscribe: List-Unsubscribe: On Mon, Jun 24, 2024 at 12:34:04PM -0700, Yosry Ahmed wrote: > On Mon, Jun 24, 2024 at 12:26 PM Matthew Wilcox wrote: > > > > On Mon, Jun 24, 2024 at 11:57:45AM -0700, Yosry Ahmed wrote: > > > On Mon, Jun 24, 2024 at 11:56 AM Matthew Wilcox wrote: > > > > > > > > On Mon, Jun 24, 2024 at 11:53:30AM -0700, Yosry Ahmed wrote: > > > > > After a page is swapped out during reclaim, __remove_mapping() will > > > > > call __delete_from_swap_cache() to replace the swap cache entry with a > > > > > shadow entry (which is an xa_value). > > > > > > > > Special entries are disjoint from shadow entries. Shadow entries have > > > > the last two bits as 01 or 11 (are congruent to 1 or 3 modulo 4). > > > > Special entries have values below 4096 which end in 10 (are congruent > > > > to 2 modulo 4). > > > > > > You are implying that we would no longer have a shadow entry for such > > > zero folios, because we will be storing a special entry instead. > > > Right? > > > > umm ... maybe I have a misunderstanding here. > > > > I'm saying that there wouldn't be a _swap_ entry here because the folio > > wouldn't be stored anywhere on the swap device. But there could be a > > _shadow_ entry. Although if the page is full of zeroes, it was probably > > never referenced and doesn't really need a shadow entry. > > Is it possible to have a shadow entry AND a special entry (e.g. > XA_ZERO_ENTRY) at the same index? This is what would be required to > maintain the current behavior (assuming we really need the shadow > entries for such zeroed folios). No, just like it's not possible to have a swap entry and a shadow entry at the same location. You have to choose. But the zero entry is an alternative to the swap entry, not the shadow entry. As I understand the swap cache, at the moment, you can have four possible results from a lookup: - NULL - a swap entry - a shadow entry - a folio Do I have that wrong?