Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3444280pxp; Tue, 22 Mar 2022 21:09:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3x+CWOUEJT+Brp/4TI3jTLuWm6DsHRyqWGTcZ2DsYtSds+oRBek0rzLKQare9qVdN82EN X-Received: by 2002:a65:6190:0:b0:382:9ac9:f951 with SMTP id c16-20020a656190000000b003829ac9f951mr7898317pgv.88.1648008564813; Tue, 22 Mar 2022 21:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648008564; cv=none; d=google.com; s=arc-20160816; b=h6O4LmsqaIvX9xJWwRwQcFaUfn8GVY6bWR4ESRBGmndMO3gRwAOoLX2y4OAfzje0iQ vNYb1V03BeLEGS4xGo1Il6LJXOqHK4U60OCe2KZvY+41tiCO37HQQ/8NCEgF345tfXNp Y+a9D3pSA1O37S9trzG2XG3z9LR2wyu/49Wl6EqbP2gwcIv6nwJTPLLO267HVjSNkFFd sgt8qsMLC/ljG8w16HOpUXx8L7CBejADv+I+ucTBO71qkf2kYjNzAHylOh4gVgdAuzuv AZlvQRk69FcbXJElrtu1D0IrkRS6u6UG7Ab50CY/TuTejGntJGcgAEq8nFq3m6K2Zavx 8X9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Al7pVKSedpXzR2mUJv99Hxat4XtGmTagJN/XJ1s2Hmo=; b=TEm8Vak2DejnIn6eHiQ/WUjUyptbBH3rYKh3jf3dq1gjsU3+9BzxZTQHZqd2UYKTzh OmVB9pQIGJBnjxoltwFr78aCbaKLDXP9HWp4Ju1v4sPM024z/wRRdCBPj45l79VbBFYi i1czIAEOWQv+zOOJLPMTpmuiXYqrXPd8v9bWG1o5JnBI+4ig0X0oeEXKFomvDZZzLVP1 E4rqSRRidvnx0OMkzad8dihMfKXZ5PW9//pFyDlYzdW+HM7H/yAzXZMhi6a+/WrOOrhV 9zb1zMOKyX7+RBLYDnJW8uORG7xsKPY8Xypg8MjC2mt3qBXYf8pvnGxRt0XCE17N5rxH nTcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=sLKrSHw+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a30-20020a634d1e000000b003816043ee1csi17643104pgb.17.2022.03.22.21.08.56; Tue, 22 Mar 2022 21:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@roeck-us.net header.s=default header.b=sLKrSHw+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237541AbiCVWId (ORCPT + 99 others); Tue, 22 Mar 2022 18:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237435AbiCVWIc (ORCPT ); Tue, 22 Mar 2022 18:08:32 -0400 X-Greylist: delayed 1502 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 22 Mar 2022 15:07:03 PDT Received: from gateway22.websitewelcome.com (gateway22.websitewelcome.com [192.185.47.206]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2AEB6F4BB for ; Tue, 22 Mar 2022 15:07:03 -0700 (PDT) Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway22.websitewelcome.com (Postfix) with ESMTP id C8546FDE4 for ; Tue, 22 Mar 2022 16:19:17 -0500 (CDT) Received: from 162-215-252-75.unifiedlayer.com ([208.91.199.152]) by cmsmtp with SMTP id WluPnKV8CRnrrWluPngDZr; Tue, 22 Mar 2022 16:19:17 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Al7pVKSedpXzR2mUJv99Hxat4XtGmTagJN/XJ1s2Hmo=; b=sLKrSHw+KVgnGkbzOB/VEO9Fg0 KeOJMxYu0Bnmzx+A12YhIb/k/Tk3UK2ZVTx0zQcuzkHsdLKhFvMGi8TmZHzt23hyDOYlMO/8cY/PQ Yunn41qFPTaRF+ofo07duityfQ5AVD1okUG5CggtfPtzAAvJALxs7O9IRjat/EIXIbzstKLf16y54 RfQAb/09FG7Hm/HVBSs2kn974LsMYF0m6yN1DlVBpdIJr7IDlc8QTKAG3WsJoVWrO1Tn4O6a7/p8Z Gz9TP+2eFoS0gMfpY7o1mvfTMdBvZOp+5drONWxhiqFH/1A6QnPVE8wlQBppd4+BysFkDdGt5WtRp L30Scr2A==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:57612 helo=localhost) by bh-25.webhostbox.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nWluO-000g4u-OE; Tue, 22 Mar 2022 21:19:16 +0000 Date: Tue, 22 Mar 2022 14:19:15 -0700 From: Guenter Roeck To: Christoph Hellwig Cc: Jens Axboe , linux-block@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, Mike Snitzer , Philipp Reisner , Ryusuke Konishi , Konstantin Komarov , Roger Pau =?iso-8859-1?Q?Monn=E9?= , dm-devel@redhat.com, "Md . Haris Iqbal " , Lars Ellenberg , linux-fsdevel@vger.kernel.org, xen-devel@lists.xenproject.org, Andrew Morton , ntfs3@lists.linux.dev, Jack Wang , Pavel Begunkov , drbd-dev@lists.linbit.com Subject: Re: [dm-devel] [PATCH 01/19] fs: remove mpage_alloc Message-ID: <20220322211915.GA2413063@roeck-us.net> References: <20220124091107.642561-1-hch@lst.de> <20220124091107.642561-2-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220124091107.642561-2-hch@lst.de> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-BWhitelist: no X-Source-IP: 108.223.40.66 X-Source-L: No X-Exim-ID: 1nWluO-000g4u-OE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 108-223-40-66.lightspeed.sntcca.sbcglobal.net (localhost) [108.223.40.66]:57612 X-Source-Auth: guenter@roeck-us.net X-Email-Count: 17 X-Source-Cap: cm9lY2s7YWN0aXZzdG07YmgtMjUud2ViaG9zdGJveC5uZXQ= X-Local-Domain: yes X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jan 24, 2022 at 10:10:49AM +0100, Christoph Hellwig wrote: > open code mpage_alloc in it's two callers and simplify the results > because of the context: > > - __mpage_writepage always passes GFP_NOFS and can thus always sleep and > will never get a NULL return from bio_alloc at all. > - do_mpage_readpage can only get a non-sleeping context for readahead > which never sets PF_MEMALLOC and thus doesn't need the retry loop > either. > > Both cases will never have __GFP_HIGH set. > With this patch in the tree, I get: [ 1.198134] Unexpected gfp: 0x2 (__GFP_HIGHMEM). Fixing up to gfp: 0x1192888 (GFP_NOWAIT|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_MOVABLE|__GFP_SKIP_KASAN_POISON). Fix your code! [ 1.198783] CPU: 0 PID: 1 Comm: init Not tainted 5.17.0-01402-g8565d64430f8 #1 [ 1.199165] Stack : 0000000000000042 0000000000000000 0000000000000008 dae882cc7dea7ec4 [ 1.199563] a8000000014f0c00 0000000000000000 a80000000146b2c8 ffffffff80d3a920 [ 1.199750] a80000000146b0e0 0000000000000001 0000000000000000 0000000000000000 [ 1.199936] 000000000003087f 0000000000000000 ffffffff806d9f54 0000000000000000 [ 1.200121] a80000000146b16f ffffffff80da0000 0000000000000001 000000000119288a [ 1.200306] ffffffff80da0000 ffffffffffffffff 000000000119288a 000000000119288a [ 1.200491] a800000001416f00 0000000000000000 ffffffff80774d30 ffffffffa0042718 [ 1.200676] ffffffff80ec2158 a800000001468000 a80000000146b2c0 0000000000000000 [ 1.200861] ffffffff80b55730 0000000000000000 a80000000146b3f8 ffffffff80d3a920 [ 1.201046] 0000000000000001 000000000119288a ffffffff80108fa0 dae882cc7dea7ec4 [ 1.201236] ... [ 1.201548] Call Trace: [ 1.201622] [] show_stack+0x38/0x118 [ 1.201960] [] dump_stack_lvl+0x50/0x6c [ 1.202105] [] kmalloc_fix_flags+0x60/0x88 [ 1.202249] [] new_slab+0x2d8/0x320 [ 1.202375] [] ___slab_alloc.constprop.0+0x33c/0x5e8 [ 1.202528] [] __slab_alloc.constprop.0+0x34/0x50 [ 1.202675] [] kmem_cache_alloc+0x320/0x368 [ 1.202811] [] bvec_alloc+0x78/0x128 [ 1.202936] [] bio_alloc_bioset+0x194/0x340 [ 1.203073] [] do_mpage_readpage+0x540/0x6e0 [ 1.203213] [] mpage_readahead+0xc0/0x198 [ 1.203346] [] read_pages+0xc0/0x2e0 [ 1.203472] [] page_cache_ra_unbounded+0x1cc/0x290 [ 1.203622] [] filemap_fault+0x4f4/0x7e8 [ 1.203753] [] __do_fault+0x44/0x190 [ 1.203878] [] __handle_mm_fault+0x7e4/0xcd0 [ 1.204015] [] handle_mm_fault+0x110/0x258 [ 1.204149] [] do_page_fault+0x110/0x4f0 [ 1.204278] [] tlb_do_page_fault_1+0x108/0x110 [ 1.204421] [] padzero+0x64/0x98 [ 1.204538] [] load_elf_binary+0x1808/0x18d0 [ 1.204677] [] bprm_execve+0x240/0x5a8 [ 1.204806] [] kernel_execve+0x144/0x200 [ 1.204937] [] try_to_run_init_process+0x18/0x58 [ 1.205085] [] kernel_init+0xb4/0x10c [ 1.205220] [] ret_from_kernel_thread+0x14/0x1c with some qemu emulations. Bisect log is attached. I can not easily revert the patch since an attempt to do so causes conflicts, so I can not test upstream without this patch. Guenter --- # bad: [8565d64430f8278bea38dab0a3ab60b4e11c71e4] Merge tag 'bounds-fixes-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux # good: [f443e374ae131c168a065ea1748feac6b2e76613] Linux 5.17 git bisect start 'HEAD' 'v5.17' # good: [5628b8de1228436d47491c662dc521bc138a3d43] Merge tag 'random-5.18-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random git bisect good 5628b8de1228436d47491c662dc521bc138a3d43 # bad: [69d1dea852b54eecd8ad2ec92a7fd371e9aec4bd] Merge tag 'for-5.18/drivers-2022-03-18' of git://git.kernel.dk/linux-block git bisect bad 69d1dea852b54eecd8ad2ec92a7fd371e9aec4bd # good: [b080cee72ef355669cbc52ff55dc513d37433600] Merge tag 'for-5.18/io_uring-statx-2022-03-18' of git://git.kernel.dk/linux-block git bisect good b080cee72ef355669cbc52ff55dc513d37433600 # bad: [22027a9811349de28f81e13e20e83299099acd3a] nvmet: replace ida_simple[get|remove] with the simler ida_[alloc|free] git bisect bad 22027a9811349de28f81e13e20e83299099acd3a # bad: [672fdcf0e7de3b1e39416ac85abf178f023271f1] block: partition include/linux/blk-cgroup.h git bisect bad 672fdcf0e7de3b1e39416ac85abf178f023271f1 # bad: [b42c1fc3d55e077d36718ad9800d89100b2aff81] block: fix the kerneldoc for bio_end_io_acct git bisect bad b42c1fc3d55e077d36718ad9800d89100b2aff81 # bad: [4b1dc86d1857f1007865cab759f2285280692eee] drbd: bio_alloc can't fail if it is allow to sleep git bisect bad 4b1dc86d1857f1007865cab759f2285280692eee # bad: [f0d911927b3c7cf5f9edb5941d0287144a602d0d] nilfs2: remove nilfs_alloc_seg_bio git bisect bad f0d911927b3c7cf5f9edb5941d0287144a602d0d # good: [e7243285c0fc87054990fcde630583586ff8ed5f] block: move blk_drop_partitions to blk.h git bisect good e7243285c0fc87054990fcde630583586ff8ed5f # bad: [d5f68a42da7a4516e7503c281a54a58727f07dc3] fs: remove mpage_alloc git bisect bad d5f68a42da7a4516e7503c281a54a58727f07dc3 # good: [322cbb50de711814c42fb088f6d31901502c711a] block: remove genhd.h git bisect good 322cbb50de711814c42fb088f6d31901502c711a # first bad commit: [d5f68a42da7a4516e7503c281a54a58727f07dc3] fs: remove mpage_alloc