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 7C1C2C3DA6F for ; Thu, 24 Aug 2023 15:25:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0A3928003B; Thu, 24 Aug 2023 11:25:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBAF68E0011; Thu, 24 Aug 2023 11:25:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D829828003B; Thu, 24 Aug 2023 11:25:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C492D8E0011 for ; Thu, 24 Aug 2023 11:25:19 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9A4E2A03DB for ; Thu, 24 Aug 2023 15:25:19 +0000 (UTC) X-FDA: 81159371958.15.CCBB8EE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id B467A120027 for ; Thu, 24 Aug 2023 15:25:17 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iAGUTPCd; spf=pass (imf29.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692890717; a=rsa-sha256; cv=none; b=1CeUiliGilIIK3BYL2DMduQpHzbwteHZN6y0VySOT0G8JKLLElbDpOzHfOz5ca8vv4Ces8 kxmJkJZn4BWpkJQnT4ascqzMXgrl5m9kiMWma0nXPwk30tTtMwwVh+wOFgNG5Qw9dktClb a9pLkLDdb7Og3zaUonzFI+gpURim5lM= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iAGUTPCd; spf=pass (imf29.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692890717; 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=aFmMXxBm+YgaqwE+DG6ZH3DhDs7W5yCR2BgBX+orSAg=; b=dBqAXDBVh9YZY1DIMF6NlD2zceojZCE/amJs1cj/bW/+NX0zu/TDUPDjy4PqTgypw22Vwc xDmW78K1mthPVTy/V262keeHqxxin2NU31tBeHT1WVQhrrgN21p+zD49DYEVHaFxia2sdj Vh3ZDpasYC6BHs+Jp77toNLoqTynBdw= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F423C67274 for ; Thu, 24 Aug 2023 15:25:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67C9DC433CC for ; Thu, 24 Aug 2023 15:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692890716; bh=zM6juq8xM0ioLZjO8HqYn5YlFgyLKPSxXfTQouHy1Hk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iAGUTPCdoT0+BiGAKECcZToTz02uLWO/Idp4vZwu6ONMRNNmy2WFeMU/N6j5RziNU +cccaXU+seqG8zDkrmJlEttgWBBnh79kpaQkImLjCHRiujliOy3KgOLHsbkhmqobJK PrFVYLHsP1RUDuYWtWLCWWz/nl7/2hGt2prRYPV1V13NRKswXTy/0lf2ARQ9xoxiqg J81yjHuYWgrcxi6jg3GDzcKHAOVKyn/16mwESCE2wN9u7PhpVWYjlX+6LyjVjSaRGj Wrf2/EGHFFMDtev9toHXdM+pwY5yvoNw39yBjINu68mGXtHYZeyGfuE54yDezq+kod 0X5klGTkOGbkw== Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-565e387000fso4324844a12.2 for ; Thu, 24 Aug 2023 08:25:16 -0700 (PDT) X-Gm-Message-State: AOJu0YxwkgAZHiMyHLxmJRHTkMlXsenSDItEhPycoMPLdjXwXuDiGksK Ns1NpyNipbZ0Q5R1PkIwh/WIbixa8A/0Z6P7q5VGkg== X-Google-Smtp-Source: AGHT+IEHow0McqsBMgXtEFTtyq5RM47lr+urwT6cDnN6OOUx+FsmxIKCak8O1onoCCYUeUTYf0QnN3a8nC1/6bTr9v0= X-Received: by 2002:a17:90a:4dc6:b0:26d:2fe5:ff2a with SMTP id r6-20020a17090a4dc600b0026d2fe5ff2amr14176041pjl.29.1692890715658; Thu, 24 Aug 2023 08:25:15 -0700 (PDT) MIME-Version: 1.0 References: <20230817-free_pcppages_bulk-v1-2-c14574a9f80c@kernel.org> <202308241221.cc5ac84a-oliver.sang@intel.com> In-Reply-To: <202308241221.cc5ac84a-oliver.sang@intel.com> From: Chris Li Date: Thu, 24 Aug 2023 08:25:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 2/2] mm/page_alloc: free_pcppages_bulk clean up To: kernel test robot Cc: oe-lkp@lists.linux.dev, lkp@intel.com, linux-mm , Andrew Morton , Kemeng Shi , baolin.wang@linux.alibaba.com, Mel Gorman , Michal Hocko , David Hildenbrand , Matthew Wilcox , Namhyung Kim , Greg Thelen , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: B467A120027 X-Stat-Signature: jt3etyuorbsrn4d4nnkmixtt3u3nywcn X-Rspam-User: X-HE-Tag: 1692890717-634931 X-HE-Meta: U2FsdGVkX18Wi35oZm9PXH/sIQga4pWtsaOugBO1X8ToSUUFrLxIDyGR4lUTo0MOkYwzxbi8LQ3IIb/dPAPoxaiLr5d8bwyPV3ttG7XxTDU0HTh03sOwOvxHGvRHrF4gVMPlQgrqKjjC/CKlzb+8N2CrrKlsQlJPhrNDaINONA3r20K5uYZgU7fKJeZoPb73CSU7l69LaRCZEdrx6XU0RlfZlqlUixcpIRrTDP6pKTuVjLcs0u/GWY2cW82qKSgiZqUOtwPpOaikYnV6GdWZT28EslNeXHSkvumzg2qBp1Uw7gSzp1qMkO+CIJN+uH9pgnvCm8IwjsZvLKwlMOhS3djTZYKJpA9V5EPjx91iHauIfFb694YbcKlx5vszphfYZn9Nc9wwtOXnYawNNCHQAkV6UEWIlXpjGNrsvWE1HjauGaSOqqw2zUIP5xs96O9v+huTCeQaxayy3KiPh4qsXO27d/wSSipOQv/V9p32nnV7Q/Zze483unQOmRSIJa+5gfNIoeJgg6xQvivJ3Ck9Uu5RvPBXcX9KY7DBldUcUQ5mu/1dzeZ7kaJV39sxgzpxjHQbk264ocM0DHEzFEiNxBqk7pKJgNGsUMydulXPv6q+yoWF9IB5zsknJhBa3+nWil6lOYcQYNv90pM++at8fQgxToNW1EX2qxaQo+FASy5RaKw2HpjJsabMZWPqILjvvUsdU6IFZNApUrHHVVxRaE/Kr4r0a4qPE7N0orun2HwIwgqxqqFevIyXUdL0Ylvp6WD1F9wOvCogGD2w9qv3A4ulH325sQIWA4GgR5g+lXnnjMjk3MNkUB6Adj4xGaMFh9KCpTcyusSuRlcP6ULIzDIfxh2rR0PGVDeYE4grCVhtqw/fPl8RJXwJvDvwDc31fr6F3LObVrmzI89gnwD75ybbqxoLUrXPg0fRVXsjstkLLkSgF+o/XGsjwwZieolorKL7rHK58wFLx0/kq7O CjZwat3W 2zu6l6dTdeIbclR/IfilcSG0F9Ik9aTpyBnqeRmZW3rqnNRRMrSdJ1/OWzl7au8fkf21ItWZ4CW1jkRj3Q7nmTnkcZK6HQ4EzJbekDk2rsd/kjuVEKaw5FqNTxF7jUaoUKJPd04s+xSeHyhvUY0tezNdR4A9fsCotTjMEENPCKj1c3kZouC9oDojRBo1EJ/QcGkawguvFCCO/07d+/nljgzOVZjERPfrCwBexJPyvBu+0KW9WE6lHRTD+1j4v4v7uPUbjeTXzHTHbUbQx1wAqeer4vO6XwHulo/0mgs+jgqHUoGt5egCoqihq/mmPxZuwZwWfN5w/PTIa1RM3kW9CNEMt+CON1+lVnkRI0GmleTj88FzrfQPTPnp182dArJnMsjhZvCwbHrcm1VLpuFBjhq9/Uc3ODmWt+rIkmNbiVOZVj4KbxXUymOe7x3T7ij2LnrKpzYuZ3hLKtP/EDucjMEaESBEjFx8nc+jhW/WCHuAm+crfBFpaonWavViEEVxRmk6dgvY5Qig+pOC9IeYcrCA+7g== 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: Hi Oliver, Indeed, that is my bad. Thanks for reporting it. The patch has been sitting in my tree for a very long time. When I adopt it for the later kernel, I accidentally drop this chunk: - if (!list_empty(list)) - break; I think that is what is missing. I will address that in the V2 and do more testing before I send it out. On Wed, Aug 23, 202 > > in testcase: boot > > compiler: gcc-12 > test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G > > (please refer to attached dmesg/kmsg for entire log/backtrace) The kernel test robot is very interesting. I see that is how to start the qemu system. How do I invoke the test once I have qemu up and running with my testing kernel? I want to replicate it before I send out the V2 version. Chris > > > > 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-lkp/202308241221.cc5ac84a-oliver.sang@intel.com > > > > [ 15.890907][ C0] BUG: kernel NULL pointer dereference, address: 00000005 > [ 15.891555][ C0] #PF: supervisor read access in kernel mode > [ 15.892037][ C0] #PF: error_code(0x0000) - not-present page > [ 15.893161][ C0] *pdpt = 000000002c9e7001 *pde = 0000000000000000 > [ 15.894410][ C0] Oops: 0000 [#1] SMP PTI > [ 15.895385][ C0] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G E 6.5.0-rc4-00242-g3373e582e78e #1 > [ 15.896801][ C0] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 > [ 15.898250][ C0] EIP: free_pcppages_bulk+0x7d/0x200 > [ 15.899281][ C0] Code: 8d 34 c6 89 75 e4 83 f8 0c 0f 84 ee 00 00 00 ba ab aa aa aa f7 e2 b8 01 00 00 00 89 d1 d1 e9 d3 e0 89 45 e0 8b 45 e4 8b 50 04 <8b> 72 04 > 8d 5a fc 83 ee 04 39 c2 0f 84 0a 01 00 00 89 4d e8 eb 28 > [ 15.914130][ C0] EAX: e4c7520c EBX: e4c9f510 ECX: 55555555 EDX: 00000001 > [ 15.915477][ C0] ESI: e4c7520c EDI: e4c75200 EBP: c1819d98 ESP: c1819d60 > [ 15.916755][ C0] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00210006 > [ 15.918067][ C0] CR0: 80050033 CR2: 00000005 CR3: 2ca6a000 CR4: 000406f0 > [ 15.919278][ C0] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 > [ 15.920468][ C0] DR6: fffe0ff0 DR7: 00000400 > [ 15.921446][ C0] Call Trace: > [ 15.922298][ C0] > [ 15.923149][ C0] ? show_regs+0x55/0x80 > [ 15.924069][ C0] ? __die+0x1d/0x80 > [ 15.924934][ C0] ? page_fault_oops+0x65/0xc0 > [ 15.925890][ C0] ? kernelmode_fixup_or_oops+0x73/0x100 > [ 15.926986][ C0] ? __bad_area_nosemaphore+0xdc/0x1c0 > [ 15.928086][ C0] ? bad_area_nosemaphore+0xf/0x40 > [ 15.929061][ C0] ? do_user_addr_fault+0x1ac/0x3c0 > [ 15.930036][ C0] ? exc_page_fault+0x51/0x140 > [ 15.930957][ C0] ? pvclock_clocksource_read_nowd+0x140/0x140 > [ 15.931997][ C0] ? handle_exception+0x133/0x133 > [ 15.932938][ C0] ? pmd_clear_huge+0x7b/0x80 > [ 15.934885][ C0] ? pvclock_clocksource_read_nowd+0x140/0x140 > [ 15.935963][ C0] ? free_pcppages_bulk+0x7d/0x200 > [ 15.936915][ C0] ? pvclock_clocksource_read_nowd+0x140/0x140 > [ 15.937954][ C0] ? free_pcppages_bulk+0x7d/0x200 > [ 15.938876][ C0] free_unref_page_commit+0x120/0x180 > [ 15.939826][ C0] free_unref_page+0xe7/0x100 > [ 15.940688][ C0] __free_pages+0x87/0xc0 > [ 15.941519][ C0] __free_slab+0xa1/0x100 > [ 15.942383][ C0] free_slab+0x27/0xc0 > [ 15.943187][ C0] discard_slab+0x38/0x40 > [ 15.944014][ C0] __unfreeze_partials+0x20c/0x240 > [ 15.946439][ C0] put_cpu_partial+0x5b/0x80 > [ 15.947347][ C0] __slab_free+0x287/0x380 > [ 15.948207][ C0] ? __mod_memcg_lruvec_state+0x3e/0x80 > [ 15.949138][ C0] kmem_cache_free+0x329/0x340 > [ 15.950003][ C0] ? mt_free_rcu+0x10/0x40 > [ 15.950805][ C0] ? free_task+0x4d/0x80 > [ 15.951594][ C0] ? mt_free_rcu+0x10/0x40 > [ 15.952390][ C0] mt_free_rcu+0x10/0x40 > [ 15.953181][ C0] rcu_do_batch+0x158/0x440 > [ 15.953998][ C0] rcu_core+0xce/0x1c0 > [ 15.954751][ C0] rcu_core_si+0xd/0x40 > [ 15.955512][ C0] __do_softirq+0xad/0x233 > [ 15.956293][ C0] ? __lock_text_end+0x3/0x3 > [ 15.957084][ C0] call_on_stack+0x45/0x80 > [ 15.957871][ C0] > [ 15.958525][ C0] ? irq_exit_rcu+0x6a/0xc0 > [ 15.959284][ C0] ? sysvec_apic_timer_interrupt+0x27/0x40 > [ 15.960136][ C0] ? handle_exception+0x133/0x133 > [ 15.960900][ C0] ? alarm_handle_timer+0xfb/0x100 > [ 15.961669][ C0] ? sysvec_call_function_single+0x40/0x40 > [ 15.962542][ C0] ? default_idle+0xb/0x40 > [ 15.963234][ C0] ? sysvec_call_function_single+0x40/0x40 > [ 15.964026][ C0] ? default_idle+0xb/0x40 > [ 15.964703][ C0] ? arch_cpu_idle+0x8/0x40 > [ 15.965379][ C0] ? default_idle_call+0x2a/0xc0 > [ 15.967867][ C0] ? cpuidle_idle_call+0x122/0x180 > [ 15.968680][ C0] ? do_idle+0x79/0xc0 > [ 15.969357][ C0] ? cpu_startup_entry+0x25/0x40 > [ 15.970106][ C0] ? rest_init+0x96/0xc0 > [ 15.970770][ C0] ? arch_call_rest_init+0xd/0x80 > [ 15.971505][ C0] ? start_kernel+0x347/0x480 > [ 15.972209][ C0] ? early_idt_handler_common+0x44/0x44 > [ 15.972969][ C0] ? i386_start_kernel+0x48/0x80 > [ 15.973678][ C0] ? startup_32_smp+0x156/0x158 > [ 15.974397][ C0] Modules linked in: intel_rapl_msr(E) intel_rapl_common(E) ata_generic(E) ppdev(E) crc32_pclmul(E) crc32c_intel(E) aesni_intel(E) ipmi_devintf( > E) ipmi_msghandler(E) crypto_simd(E) ata_piix(E) cryptd(E) rapl(E) i2c_piix4(E) psmouse(E) evdev(E) serio_raw(E) bochs(E) drm_vram_helper(E) drm_kms_helper(E) drm_tt > m_helper(E) ttm(E) libata(E) parport_pc(E) floppy(E) parport(E) qemu_fw_cfg(E) button(E) drm(E) configfs(E) fuse(E) autofs4(E) > [ 15.978905][ C0] CR2: 0000000000000005 > [ 15.979621][ C0] ---[ end trace 0000000000000000 ]--- > [ 15.980419][ C0] EIP: free_pcppages_bulk+0x7d/0x200 > [ 15.981222][ C0] Code: 8d 34 c6 89 75 e4 83 f8 0c 0f 84 ee 00 00 00 ba ab aa aa aa f7 e2 b8 01 00 00 00 89 d1 d1 e9 d3 e0 89 45 e0 8b 45 e4 8b 50 04 <8b> 72 04 > 8d 5a fc 83 ee 04 39 c2 0f 84 0a 01 00 00 89 4d e8 eb 28 > [ 15.983663][ C0] EAX: e4c7520c EBX: e4c9f510 ECX: 55555555 EDX: 00000001 > [ 15.984705][ C0] ESI: e4c7520c EDI: e4c75200 EBP: c1819d98 ESP: c1819d60 > [ 15.985738][ C0] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00210006 > [ 15.986822][ C0] CR0: 80050033 CR2: 00000005 CR3: 2ca6a000 CR4: 000406f0 > [ 15.987832][ C0] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 > [ 15.988839][ C0] DR6: fffe0ff0 DR7: 00000400 > [ 15.989679][ C0] Kernel panic - not syncing: Fatal exception in interrupt > [ 15.996118][ C0] Kernel Offset: disabled > > > > The kernel config and materials to reproduce are available at: > https://download.01.org/0day-ci/archive/20230824/202308241221.cc5ac84a-oliver.sang@intel.com > > > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki > >