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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99AF7C433F5 for ; Fri, 29 Apr 2022 15:12:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377725AbiD2PQP (ORCPT ); Fri, 29 Apr 2022 11:16:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231968AbiD2PQO (ORCPT ); Fri, 29 Apr 2022 11:16:14 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89445D447C for ; Fri, 29 Apr 2022 08:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=AnVpib+N/9oR4R907B1WRB3p9rU5ohvmNd2HSih7kyc=; b=UyX2qQnUW5OyQrzntkwFzGhK2U 3bd0r6oHSJnxnO/zUSmipWBfpnwlT8DaBi9GVhbI4nrcUC9VBiPMAw/Bzu1GffvbaVSrJXIGg99Lz 7hQDH2KVQ8uVfpnwHh/uvgS5ibjdSOuSsMQXj3e+JsxjsuM+hCA3dKUfPR6kyFpxAx2D71Z+WGZLE 9oZiPXHKfHNWOmQdgCubogO4DK4GbmyJ2ePRm2LiJOeO7b80muPvwfmyIlpbmG8qPDAbDKfOC1PMw PW6V5T7l1T2UiVodPsrwjegb3lZEju3i6QO0GhjpZIhAIQAvAtxdDK09pfQwl6SqUDORCw725/lRC nkL2WuCA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkSIf-00Bj2o-63; Fri, 29 Apr 2022 15:12:53 +0000 Date: Fri, 29 Apr 2022 08:12:53 -0700 From: Christoph Hellwig To: Qu Wenruo Cc: Christoph Hellwig , Qu Wenruo , linux-btrfs@vger.kernel.org Subject: Re: [PATCH RFC v2 04/12] btrfs: add btrfs_read_repair_ctrl to record corrupted sectors Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, Apr 29, 2022 at 08:09:38AM +0800, Qu Wenruo wrote: > On the other hand, we're already allocating memory inside endio > function, for a long long time. > > Check endio_readpage_release_extent(), they all need to pre-allocate > memory for extent tree update (although using mostly ATOMIC gfp flags). > > I guess it's an abuse and we would like to remove it in the long run? Yes, we should handle it. In practice small GFP_ATOMIC allocations do not fail, so this probably hasn't been much of an issue. Allocations that can be rather larger like the bitmaps on the other hand do have a real chance of failing under enough memory pressure.