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 94929C5B552 for ; Sun, 8 Jun 2025 21:45:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 687F86B007B; Sun, 8 Jun 2025 17:45:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 63ED06B008C; Sun, 8 Jun 2025 17:45:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3ED3A6B007B; Sun, 8 Jun 2025 17:45:13 -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 149D96B0088 for ; Sun, 8 Jun 2025 17:45:13 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C31A210046A for ; Sun, 8 Jun 2025 21:45:12 +0000 (UTC) X-FDA: 83533564464.10.D8AD7A9 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by imf24.hostedemail.com (Postfix) with ESMTP id 7211C180009 for ; Sun, 8 Jun 2025 21:45:10 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kLDxULPD; spf=pass (imf24.hostedemail.com: domain of lkp@intel.com designates 198.175.65.21 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749419110; 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=iWpDBEepwoaXowRVENVX6lj1MDdu5nyNROCu/ExQg4w=; b=6s20jZKMy8pejuNj7cLns9bf5rGxRvZ6JU42JD13IrAsishuY8k4Bj2MWHzj+eA2Dp+5p7 6+gsNsEBpS8F6H+Fw+Z845vHAir2O1McmIHdph+9XvS7ZWC1xK2XuX2tDEo/24Hgt88a5Y M+vU+zxn4joC2xA780gPpA2s4yYhaSc= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kLDxULPD; spf=pass (imf24.hostedemail.com: domain of lkp@intel.com designates 198.175.65.21 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749419110; a=rsa-sha256; cv=none; b=kaFSu0jd9aHGEIXHEOXv84LfLBSZCD0KlJv6dqYQVrpsJKZ21+uUJ/Bh7ugKwu5w3P/fId ErWc14FMtTbXs8r15c6kyac2q3UpIQPORW0tCVM+Drs1OvTOiJf9XEMEiSDcZHflrSI09q Zk3S1/nSFVN0ArcdnLQvKKQzStwk4pE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1749419111; x=1780955111; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=GeLqfCISxlJ35ItAVg3veXROlWc+r3oA703qOErV10o=; b=kLDxULPDuZYSUduQJCkHJ32GOohTtK/t2fqf0DlbuxI4duuEr/9UwHGZ g/1EnsjXQzijKy5wbOS51xFelGYZiZFWgvsUjjpBl+7hRsRUAPuxWVI2X M1/0IvuRTuw4MpLSPlGr4HKaFQ5Y+aXdOkfK3Y4PCHsOZfih+cdyM0nKz 05EzgWMXdT/+z7mXYlBD+PQTd/BDNV8lUuXKOAnRfDNYCLRLXtWaxnSVM IyVyUGGIjyGlBfQcE9PILS/m1Tq8lDgbBvtWxQbDZlZKMAgyU9xBhsZTA H7R46iNoKX3mkdQ+QuMFNZvpEaMyN3B/NbXBZXfcziC3M8NIWkA88uQBs Q==; X-CSE-ConnectionGUID: Q7KIRsTIRcWlHtbsZ7ujCw== X-CSE-MsgGUID: iofkHl9GTRmHX0ObveHxfQ== X-IronPort-AV: E=McAfee;i="6800,10657,11458"; a="51355936" X-IronPort-AV: E=Sophos;i="6.16,221,1744095600"; d="scan'208";a="51355936" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2025 14:45:08 -0700 X-CSE-ConnectionGUID: SciDia4PTMyFaiAXJKGB+g== X-CSE-MsgGUID: wIB1hRdLQCe/LQAewrz24Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,221,1744095600"; d="scan'208";a="150161632" Received: from lkp-server01.sh.intel.com (HELO e8142ee1dce2) ([10.239.97.150]) by fmviesa003.fm.intel.com with ESMTP; 08 Jun 2025 14:45:04 -0700 Received: from kbuild by e8142ee1dce2 with local (Exim 4.96) (envelope-from ) id 1uONp8-0006ZP-0a; Sun, 08 Jun 2025 21:45:02 +0000 Date: Mon, 9 Jun 2025 05:44:47 +0800 From: kernel test robot To: Kairui Song , linux-mm@kvack.org Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Andrew Morton , Linux Memory Management List , Hugh Dickins , Baolin Wang , Kemeng Shi , Chris Li , Nhat Pham , Baoquan He , Barry Song , Usama Arif , linux-kernel@vger.kernel.org, Kairui Song Subject: Re: [PATCH] mm/shmem, swap: fix softlockup with mTHP swapin Message-ID: <202506090525.yM9XIl8O-lkp@intel.com> References: <20250608192713.95875-1-ryncsn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250608192713.95875-1-ryncsn@gmail.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7211C180009 X-Stat-Signature: kz155uck79rwsnqeh891w7a3p9dy65h5 X-Rspam-User: X-HE-Tag: 1749419110-548948 X-HE-Meta: U2FsdGVkX18Wkz01gkLDCzKaRQGkNoOZuiNa8ErbI+UHE7OuOE1zuPs+1vCzKdCEsiUUBGuGlfHbn6sS1nN6mPwwMOxhQ8GtzslX0LbDoY+zO/V95w5SJLXuc1gW+Cwb3d49P+tX3nPF5dnRt4n+hGmXbPAX3v3//j/r58TEpzHWhR8UzORa8KTllvjr55Zhectd+qxRgMrOjw1YOUm8c3i0Bmg4hK15H6qtru9YE4sUaAh2bukQakqebfH7dtDiHKyZt988Zw+1m+vY1EpVqQmSD/OJi41aSpEdtnBEvs+pGHKfejH9VVq2ekM4S7vUwpMnrrQHI3U8aPnQfCYBf4M/aZPMpcSVEG7CMBnrZUnqwVtOfFLNwiJcxsX7NgCxZ+iYMbx4C/6Hp0TwAmE/dM+vq5IEPdtpf2TnYrOOX9CkABb5IRDs3pW2AbN2O+MogdCEZ81n2rmaLQAtUx9i7qR9uX5otOmz5pWnXnmZLqsB5y5CDZevoL9XFj91EfwuUvyn2b7mCzb1c8usxEpj5PsiOkP5u+OF8cYFsNBimFGjlkQ0WlTCg25H5j2YkzwHspIL2C77Q+bHlmE3oyMg6a66hlpAj4wtmrwaPORTp/9cEXelbcWbI15kIi5iRmZWMQc4J3mKd1hAGXoGZ0mMltmdV1G1yx9UfGzx+LoaMa+TY31UKB2fkdhG7AfBKzeCL4XhUU06YdJC5xVVA9n/N3BOgjY/i0NumEIhlbdnzo4dOBrqilFhoYjxldHYVnkhE5xGZPofRYnyiEG20jWNb/+DHiBJmuYY/CZDAiaXZiyZIQ3uc1vXf68G5GZmmLfgdYrFSpWMrTnG4EfxZIPP5ieSSAvFDQfFongYy8X+CMwmhxspazVGV5yGb1M0X71AkbhdM0rS9wtISCQdEqxlYezUVfOFQMLAkwUruPHdSAt8+1vtyjmbMUj92F0E7GmIY6wzOUqw11esG/rCMSK nnjs7iKZ DCy1mHw3O+DAT/BBtS3jupMWAYIyFl8xKPHLe9NJyC110iKbGGskOH0JQOgVja3tT4iQdvpooX2Rae18cPUdYZa1Ad2lgpiqdkaacNI7LatVurlEmfGvK7keJf1WK8brLW3wlJ/JL43I8yUL/NILrSXf5s/KgldkRPgW9B+jubmz9jEklwLPDP0fcJSpNnPLdjACgnKilU0+Ocm+Twq+a4YDhY5igoA0bm+DULtMDahnfpW3+b8tMsUiaEpenuCBECpuOm4fQjjsz67gQE3Jvj377x9mwNzU3P4K4hSjOdfLZDNPyPIB2afqAGiSZXDuWNdsPaJROUQiktE/qpBL7uSa0xngspdI7TudL 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: Hi Kairui, kernel test robot noticed the following build errors: [auto build test ERROR on akpm-mm/mm-everything] url: https://github.com/intel-lab-lkp/linux/commits/Kairui-Song/mm-shmem-swap-fix-softlockup-with-mTHP-swapin/20250609-032924 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20250608192713.95875-1-ryncsn%40gmail.com patch subject: [PATCH] mm/shmem, swap: fix softlockup with mTHP swapin config: arm-randconfig-003-20250609 (https://download.01.org/0day-ci/archive/20250609/202506090525.yM9XIl8O-lkp@intel.com/config) compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250609/202506090525.yM9XIl8O-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202506090525.yM9XIl8O-lkp@intel.com/ All errors (new ones prefixed by >>): | ^ include/linux/huge_mm.h:108:28: note: expanded from macro 'HPAGE_PMD_SHIFT' 108 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | ^ note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ In file included from mm/shmem.c:24: In file included from include/linux/fs.h:7: In file included from include/linux/wait_bit.h:8: In file included from include/linux/wait.h:7: include/linux/list.h:37:2: warning: attribute 'error' is already applied with different arguments [-Wignored-attributes] 37 | WRITE_ONCE(list->next, list); | ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' 60 | compiletime_assert_rwonce_type(x); \ | ^ include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type' 36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ | ^ include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ mm/shmem.c:1904:20: note: previous attribute is here 1904 | count_vm_event(THP_FILE_FALLBACK); | ^ include/linux/vm_event_item.h:196:30: note: expanded from macro 'THP_FILE_FALLBACK' 196 | #define THP_FILE_FALLBACK ({ BUILD_BUG(); 0; }) | ^ include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^ include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ In file included from mm/shmem.c:24: In file included from include/linux/fs.h:7: In file included from include/linux/wait_bit.h:8: In file included from include/linux/wait.h:7: include/linux/list.h:37:2: warning: attribute 'error' is already applied with different arguments [-Wignored-attributes] 37 | WRITE_ONCE(list->next, list); | ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' 60 | compiletime_assert_rwonce_type(x); \ | ^ include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type' 36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ | ^ include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ mm/shmem.c:1905:20: note: previous attribute is here 1905 | count_vm_event(THP_FILE_FALLBACK_CHARGE); | ^ include/linux/vm_event_item.h:197:37: note: expanded from macro 'THP_FILE_FALLBACK_CHARGE' 197 | #define THP_FILE_FALLBACK_CHARGE ({ BUILD_BUG(); 0; }) | ^ include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^ include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ >> mm/shmem.c:2003:7: error: call to undeclared function 'non_swapcache_batch'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 2003 | if (non_swapcache_batch(entry, nr_pages) != nr_pages) | ^ In file included from mm/shmem.c:24: In file included from include/linux/fs.h:7: In file included from include/linux/wait_bit.h:8: In file included from include/linux/wait.h:7: include/linux/list.h:37:2: warning: attribute 'error' is already applied with different arguments [-Wignored-attributes] 37 | WRITE_ONCE(list->next, list); | ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' 60 | compiletime_assert_rwonce_type(x); \ | ^ include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type' 36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ | ^ include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ mm/shmem.c:2531:20: note: previous attribute is here 2531 | count_vm_event(THP_FILE_ALLOC); | ^ include/linux/vm_event_item.h:195:27: note: expanded from macro 'THP_FILE_ALLOC' 195 | #define THP_FILE_ALLOC ({ BUILD_BUG(); 0; }) | ^ include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^ include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ In file included from mm/shmem.c:24: In file included from include/linux/fs.h:7: In file included from include/linux/wait_bit.h:8: In file included from include/linux/wait.h:7: include/linux/list.h:37:2: warning: attribute 'error' is already applied with different arguments [-Wignored-attributes] 37 | WRITE_ONCE(list->next, list); | ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' 60 | compiletime_assert_rwonce_type(x); \ | ^ include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type' 36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ | ^ include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ mm/shmem.c:2790:15: note: previous attribute is here 2790 | hpage_size = HPAGE_PMD_SIZE; | ^ include/linux/huge_mm.h:115:34: note: expanded from macro 'HPAGE_PMD_SIZE' 115 | #define HPAGE_PMD_SIZE ((1UL) << HPAGE_PMD_SHIFT) | ^ include/linux/huge_mm.h:108:28: note: expanded from macro 'HPAGE_PMD_SHIFT' 108 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | ^ include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^ note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:565:2: note: expanded from macro 'compiletime_assert' 565 | __compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:547:4: note: expanded from macro '__compiletime_assert' 547 | __compiletime_error(msg); \ | ^ include/linux/compiler_attributes.h:138:56: note: expanded from macro '__compiletime_error' 138 | # define __compiletime_error(msg) __attribute__((__error__(msg))) | ^ In file included from mm/shmem.c:24: In file included from include/linux/fs.h:7: In file included from include/linux/wait_bit.h:8: In file included from include/linux/wait.h:7: include/linux/list.h:37:2: warning: attribute 'error' is already applied with different arguments [-Wignored-attributes] 37 | WRITE_ONCE(list->next, list); | ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' 60 | compiletime_assert_rwonce_type(x); \ | ^ include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletime_assert_rwonce_type' vim +/non_swapcache_batch +2003 mm/shmem.c 1954 1955 static struct folio *shmem_swap_alloc_folio(struct inode *inode, 1956 struct vm_area_struct *vma, pgoff_t index, 1957 swp_entry_t entry, int order, gfp_t gfp) 1958 { 1959 struct shmem_inode_info *info = SHMEM_I(inode); 1960 struct folio *new; 1961 void *shadow; 1962 int nr_pages; 1963 1964 /* 1965 * We have arrived here because our zones are constrained, so don't 1966 * limit chance of success with further cpuset and node constraints. 1967 */ 1968 gfp &= ~GFP_CONSTRAINT_MASK; 1969 if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && order > 0) { 1970 gfp_t huge_gfp = vma_thp_gfp_mask(vma); 1971 1972 gfp = limit_gfp_mask(huge_gfp, gfp); 1973 } 1974 1975 new = shmem_alloc_folio(gfp, order, info, index); 1976 if (!new) 1977 return ERR_PTR(-ENOMEM); 1978 1979 nr_pages = folio_nr_pages(new); 1980 if (mem_cgroup_swapin_charge_folio(new, vma ? vma->vm_mm : NULL, 1981 gfp, entry)) { 1982 folio_put(new); 1983 return ERR_PTR(-ENOMEM); 1984 } 1985 1986 /* 1987 * Prevent parallel swapin from proceeding with the swap cache flag. 1988 * 1989 * Of course there is another possible concurrent scenario as well, 1990 * that is to say, the swap cache flag of a large folio has already 1991 * been set by swapcache_prepare(), while another thread may have 1992 * already split the large swap entry stored in the shmem mapping. 1993 * In this case, shmem_add_to_page_cache() will help identify the 1994 * concurrent swapin and return -EEXIST. 1995 */ 1996 if (swapcache_prepare(entry, nr_pages)) { 1997 folio_put(new); 1998 1999 /* 2000 * A smaller folio is in the swap cache, mTHP swapin will always fail 2001 * until it's gone. Return -EINVAL to fallback to order 0. 2002 */ > 2003 if (non_swapcache_batch(entry, nr_pages) != nr_pages) 2004 return ERR_PTR(-EINVAL); 2005 2006 return ERR_PTR(-EEXIST); 2007 } 2008 2009 __folio_set_locked(new); 2010 __folio_set_swapbacked(new); 2011 new->swap = entry; 2012 2013 memcg1_swapin(entry, nr_pages); 2014 shadow = get_shadow_from_swap_cache(entry); 2015 if (shadow) 2016 workingset_refault(new, shadow); 2017 folio_add_lru(new); 2018 swap_read_folio(new, NULL); 2019 return new; 2020 } 2021 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki