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 9FAA2C07545 for ; Tue, 24 Oct 2023 08:17:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05A396B0191; Tue, 24 Oct 2023 04:17:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00A836B0192; Tue, 24 Oct 2023 04:17:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E13E56B0193; Tue, 24 Oct 2023 04:17:56 -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 D292B6B0191 for ; Tue, 24 Oct 2023 04:17:56 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9B445120DAB for ; Tue, 24 Oct 2023 08:17:56 +0000 (UTC) X-FDA: 81379651752.03.D012495 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by imf02.hostedemail.com (Postfix) with ESMTP id DFCC280018 for ; Tue, 24 Oct 2023 08:17:53 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=TKJrxhB+; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 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=1698135474; 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=p52LxOJPtkcF5d1AAzYzH/PLbLUWo8yBT2vgcyMqJog=; b=O2KNiRX4pa8g87UroEBRQA6qdZv07xvUegIf9GwekIAp8WSesnn28Kq2h8gWxupC+xHd2e ZeybpBM3giLG8abKEVwcqe3J+9b2iCtNC714DsJ3lb4tEQWwjD4zS/jJGUornIDWNEdGx1 IF2bQshssE10N7HIFCMRLFdBXb7WpIE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698135474; a=rsa-sha256; cv=none; b=IYFD2EBeSvUlrqW51XRmjYxJwEbpRV39FT0jbkU4fFSrCqGAsw7xQOmDrqv1ogOaobzhbR pMGR5c2QLZFjtlFpDeVp/aZp7Yzm4DFMBK+E0DTsPhUYnGLjuD7bVvWMlpeQggCc/BPs2j kLqxu5f6GdbvZMPJ0gop09QPd2xrqFA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=TKJrxhB+; spf=pass (imf02.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698135474; x=1729671474; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=bYTCDhXw6YyC1xr7oYdPRrsPB2GJaOEbojy+Ca8+ZB0=; b=TKJrxhB+k1nHOulZiXqkWVBwgykN34VhVL+E6GdxO7GwUglsrZuNcrdw Bv0oEuZysHTfi8qxCIUF7mAisC7ADlJMByuugZjRj46NL5CoLu9dNzTN4 RWCZITrw6F9Uk58F6L6hammCFj0ML3hQuafrsUrRDp4A/SOXQ4pTewOe7 xd4LUfHRUXxSDdeBJQpvTyVYLJviOySR5uXTfHIM0XnU6Bw2kooSmi0g/ a5E7yka6Quw7ZAl0Nm3IlwATukbaUTH5SgimZcYWmRarQ07F6Hiwxbyv4 cp0A/pepoQYc07pQnr4laQ2cx4TDLHIRpukzrsmipDQ2A5Z2jTCIH9mKk w==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="389856668" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="389856668" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 01:17:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="828741639" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="828741639" Received: from lkp-server01.sh.intel.com (HELO 8917679a5d3e) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 24 Oct 2023 01:17:45 -0700 Received: from kbuild by 8917679a5d3e with local (Exim 4.96) (envelope-from ) id 1qvCbf-0007hJ-1w; Tue, 24 Oct 2023 08:17:43 +0000 Date: Tue, 24 Oct 2023 16:17:23 +0800 From: kernel test robot To: Hugh Dickins , Andrew Morton Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Johannes Weiner , domenico cerasuolo , Andi Kleen , Christoph Lameter , Matthew Wilcox , Mike Kravetz , David Hildenbrand , Suren Baghdasaryan , Yang Shi , Sidhartha Kumar , Vishal Moola , Kefeng Wang , Greg Kroah-Hartman , Tejun Heo , Mel Gorman , Michal Hocko , "Huang, Ying" , Nhat Pham , Yosry Ahmed , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mempolicy: alloc_pages_mpol() for NUMA policy without vma: fix Message-ID: <202310241551.uY40myKo-lkp@intel.com> References: <00dc4f56-e623-7c85-29ea-4211e93063f6@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00dc4f56-e623-7c85-29ea-4211e93063f6@google.com> X-Rspamd-Queue-Id: DFCC280018 X-Rspam-User: X-Stat-Signature: tccwnj8ft7kr6k89mu6wogde4gyb439u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yfYuOt9OptHUPmUPLk5thDnjKqb8nC6CF5LWt5Hdhx67yXvRoNcCYGH5MW12A39F5FHjHQ2dbgpU6dE9naGw8Bv7aTYWk/f71rUT6jiJiHzgwIzFtXrc1iILmWJM3h/TeOVrlIAB+ZH7S92TYFhy+yEpeCjQ7BSzWzDtOjC8UeyIXgUa67ML6ZFi3pevQBgg/3ABS8bAmFgwXLet5SKYzlq5IHWGGdiocRmN0VZfoiki09QOBt64CltAjF8qtEsmH15bv/U53AvsFA1YRNdYewPoXIkCQSPOFW9EllkdZuVev+n5x4OiO1ekuPTTCNZKXgChpNnHiIo6x2TKw48PuKF 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 Hugh, kernel test robot noticed the following build warnings: url: https://github.com/intel-lab-lkp/linux/commits/UPDATE-20231024-144517/Hugh-Dickins/hugetlbfs-drop-shared-NUMA-mempolicy-pretence/20231003-173301 base: the 10th patch of https://lore.kernel.org/r/74e34633-6060-f5e3-aee-7040d43f2e93%40google.com patch link: https://lore.kernel.org/r/00dc4f56-e623-7c85-29ea-4211e93063f6%40google.com patch subject: [PATCH] mempolicy: alloc_pages_mpol() for NUMA policy without vma: fix config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231024/202310241551.uY40myKo-lkp@intel.com/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231024/202310241551.uY40myKo-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/202310241551.uY40myKo-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from mm/zswap.c:41: mm/internal.h: In function 'shrinker_debugfs_name_alloc': mm/internal.h:1232:9: warning: function 'shrinker_debugfs_name_alloc' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] 1232 | shrinker->name = kvasprintf_const(GFP_KERNEL, fmt, ap); | ^~~~~~~~ mm/zswap.c: In function 'zswap_writeback_entry': mm/zswap.c:1322:16: error: implicit declaration of function 'get_task_policy'; did you mean 'get_vma_policy'? [-Werror=implicit-function-declaration] 1322 | mpol = get_task_policy(current); | ^~~~~~~~~~~~~~~ | get_vma_policy >> mm/zswap.c:1322:14: warning: assignment to 'struct mempolicy *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1322 | mpol = get_task_policy(current); | ^ cc1: some warnings being treated as errors vim +1322 mm/zswap.c 1282 1283 /********************************* 1284 * writeback code 1285 **********************************/ 1286 /* 1287 * Attempts to free an entry by adding a page to the swap cache, 1288 * decompressing the entry data into the page, and issuing a 1289 * bio write to write the page back to the swap device. 1290 * 1291 * This can be thought of as a "resumed writeback" of the page 1292 * to the swap device. We are basically resuming the same swap 1293 * writeback path that was intercepted with the zswap_store() 1294 * in the first place. After the page has been decompressed into 1295 * the swap cache, the compressed version stored by zswap can be 1296 * freed. 1297 */ 1298 static int zswap_writeback_entry(struct zswap_entry *entry, 1299 struct zswap_tree *tree) 1300 { 1301 swp_entry_t swpentry = entry->swpentry; 1302 struct page *page; 1303 struct mempolicy *mpol; 1304 struct scatterlist input, output; 1305 struct crypto_acomp_ctx *acomp_ctx; 1306 struct zpool *pool = zswap_find_zpool(entry); 1307 bool page_was_allocated; 1308 u8 *src, *tmp = NULL; 1309 unsigned int dlen; 1310 int ret; 1311 struct writeback_control wbc = { 1312 .sync_mode = WB_SYNC_NONE, 1313 }; 1314 1315 if (!zpool_can_sleep_mapped(pool)) { 1316 tmp = kmalloc(PAGE_SIZE, GFP_KERNEL); 1317 if (!tmp) 1318 return -ENOMEM; 1319 } 1320 1321 /* try to allocate swap cache page */ > 1322 mpol = get_task_policy(current); 1323 page = __read_swap_cache_async(swpentry, GFP_KERNEL, mpol, 1324 NO_INTERLEAVE_INDEX, &page_was_allocated); 1325 if (!page) { 1326 ret = -ENOMEM; 1327 goto fail; 1328 } 1329 1330 /* Found an existing page, we raced with load/swapin */ 1331 if (!page_was_allocated) { 1332 put_page(page); 1333 ret = -EEXIST; 1334 goto fail; 1335 } 1336 1337 /* 1338 * Page is locked, and the swapcache is now secured against 1339 * concurrent swapping to and from the slot. Verify that the 1340 * swap entry hasn't been invalidated and recycled behind our 1341 * backs (our zswap_entry reference doesn't prevent that), to 1342 * avoid overwriting a new swap page with old compressed data. 1343 */ 1344 spin_lock(&tree->lock); 1345 if (zswap_rb_search(&tree->rbroot, swp_offset(entry->swpentry)) != entry) { 1346 spin_unlock(&tree->lock); 1347 delete_from_swap_cache(page_folio(page)); 1348 ret = -ENOMEM; 1349 goto fail; 1350 } 1351 spin_unlock(&tree->lock); 1352 1353 /* decompress */ 1354 acomp_ctx = raw_cpu_ptr(entry->pool->acomp_ctx); 1355 dlen = PAGE_SIZE; 1356 1357 src = zpool_map_handle(pool, entry->handle, ZPOOL_MM_RO); 1358 if (!zpool_can_sleep_mapped(pool)) { 1359 memcpy(tmp, src, entry->length); 1360 src = tmp; 1361 zpool_unmap_handle(pool, entry->handle); 1362 } 1363 1364 mutex_lock(acomp_ctx->mutex); 1365 sg_init_one(&input, src, entry->length); 1366 sg_init_table(&output, 1); 1367 sg_set_page(&output, page, PAGE_SIZE, 0); 1368 acomp_request_set_params(acomp_ctx->req, &input, &output, entry->length, dlen); 1369 ret = crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait); 1370 dlen = acomp_ctx->req->dlen; 1371 mutex_unlock(acomp_ctx->mutex); 1372 1373 if (!zpool_can_sleep_mapped(pool)) 1374 kfree(tmp); 1375 else 1376 zpool_unmap_handle(pool, entry->handle); 1377 1378 BUG_ON(ret); 1379 BUG_ON(dlen != PAGE_SIZE); 1380 1381 /* page is up to date */ 1382 SetPageUptodate(page); 1383 1384 /* move it to the tail of the inactive list after end_writeback */ 1385 SetPageReclaim(page); 1386 1387 /* start writeback */ 1388 __swap_writepage(page, &wbc); 1389 put_page(page); 1390 zswap_written_back_pages++; 1391 1392 return ret; 1393 1394 fail: 1395 if (!zpool_can_sleep_mapped(pool)) 1396 kfree(tmp); 1397 1398 /* 1399 * If we get here because the page is already in swapcache, a 1400 * load may be happening concurrently. It is safe and okay to 1401 * not free the entry. It is also okay to return !0. 1402 */ 1403 return ret; 1404 } 1405 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki