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 9FD4ECCA47E for ; Tue, 14 Jun 2022 16:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351635AbiFNQrn (ORCPT ); Tue, 14 Jun 2022 12:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344352AbiFNQrT (ORCPT ); Tue, 14 Jun 2022 12:47:19 -0400 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF21E29341 for ; Tue, 14 Jun 2022 09:47:02 -0700 (PDT) Received: by mail-yb1-xb2b.google.com with SMTP id l204so16085550ybf.10 for ; Tue, 14 Jun 2022 09:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XDk/gviZ4PTB0F4aeM/SYkP/gckoTZKcQotKkjmgkbU=; b=UVo7z7mq83OdvUMfv2zalYzpjivYTuojc8nrC14VtzHQxfO8kkrbOasAwYDGrmh0Kr TPWc0pt/+WTr1mK679VBnfsxfJSlmVDdvJ3irqhAxmkoAx4FZyftOa92c55uGWg46fGk TdeH+DwIPD6MdYHH/1Jk2bwZMF8Li/tN3dYF48d71K87UHk4aSTUsKGoVJ/WFX7QGdRI WUP6m+iWKKgwgI4iEZMZPYuix0X3vA0PE9jMY5DudkbQGiz+Y33Dbzk6rPJIk+Wro6vk D8eKjKUczvkIQmPIhuCy3K231YVzvYQ5+wSL6oRpyTUF/8ZI14KP36My6ida7g7SkjWH t5iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XDk/gviZ4PTB0F4aeM/SYkP/gckoTZKcQotKkjmgkbU=; b=7BdfRMisppXJb2/AL2KplEzV+cKzToeHC+Z6a/eYlyDJd0TvEfwQtpgPrVFctCCght yTXb0lrmC/8jDBPAsnaUJyCEaVGFohl7xSrSNNGaEiWHPxR0DAwlljJxCHqEdYtSESx5 QM30HCOnbwAwNyXXjwmz/WYOpdovLM3+LfsviY2cR5LUR5hcFbkAPwUgaJd/4bWp3ZRS 1k+pbNOpG1yfBJWhmkNmA++nP0IBm41DYckD6389H1iqMp/EfvDy4J5tz5Zn/SKuh3hB PbjE7M0P+FvdJSqwlEURuU7wIvl7XD27B/rcXq/x1JgYGNLk8RIv1TofHbFsrC6HMeVC UvoA== X-Gm-Message-State: AJIora9jArbTmpu9hkB66cv7qVjFspw5G3ghFlKmXHVrPs0FxB4o+rwT PmZLj2yjNwiXCRmYloTCDsp9NRS+pL9YkZHCx0s= X-Google-Smtp-Source: AGRyM1v5cuCGYw9RPYwQDmZWRztbN8i22S3AMOZQ1Zdps8kxiWn7B6Dux4ERGYj+6pPK+GABe7xiCvTpqdRn6UHJIaE= X-Received: by 2002:a25:4688:0:b0:664:68b5:e283 with SMTP id t130-20020a254688000000b0066468b5e283mr6098349yba.546.1655225221744; Tue, 14 Jun 2022 09:47:01 -0700 (PDT) MIME-Version: 1.0 References: <20220613155612.402297-1-daeho43@gmail.com> In-Reply-To: From: Daeho Jeong Date: Tue, 14 Jun 2022 09:46:50 -0700 Message-ID: Subject: Re: [f2fs-dev] [PATCH] f2fs: handle decompress only post processing in softirq To: Gao Xiang Cc: Eric Biggers , Daeho Jeong , Nathan Huckleberry , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > Some my own previous thoughts about this strategy: > > - If we allocate all memory and map these before I/Os, all inflight I/Os > will keep such temporary pages all the time until decompression is > finished. In contrast, if we allocate or reuse such pages just before > decompression, it would minimize the memory footprints. > > I think it will impact the memory numbers at least on the very > low-ended devices with bslow storage. (I've seen f2fs has some big > mempool already) > > - Many compression algorithms are not suitable in the softirq contexts, > also I vaguely remembered if softirq context lasts for > 2ms, it will > push into ksoftirqd instead so it's actually another process context. > And it may delay other important interrupt handling. > > - Go back to the non-deterministic scheduling of workqueues. I guess it > may be just due to scheduling punishment due to a lot of CPU consuming > due to decompression before so the priority becomes low, but that is > just a pure guess. May be we need to use RT scheduling policy instead. > > At least with WQ_HIGHPRI for dm-verity at least, but I don't find > WQ_HIGHPRI mark for dm-verity. > > Thanks, > Gao Xiang I totally understand what you are worried about. However, in the real world, non-determinism from workqueues is more harsh than we expected. As you know, reading I/Os in the system are critical paths most of the time and now I/O variations with workqueue are too bad. I also think it's better that we have RT scheduling like things here. We could think about it more. Thanks, 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58760C433EF for ; Tue, 14 Jun 2022 16:47:15 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1o19hA-0003oB-G9; Tue, 14 Jun 2022 16:47:13 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o19h9-0003o1-AV for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Jun 2022 16:47:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version: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=XDk/gviZ4PTB0F4aeM/SYkP/gckoTZKcQotKkjmgkbU=; b=EJTANioWLLonV4CRC2TyAkm6yu WD/7+TFEKSDUijvhgGK/D2sBQDwrNanDgRTYkrq0tC/ohyT5qf5AIi1H1qasV03awZu6j1thDKxkx Tk817P+/WK7ILGnsnq1h9nnFvH9feouPx3jCmmqHvjl/vOTxnhNlv4mxFn2EaPawUkls=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version: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=XDk/gviZ4PTB0F4aeM/SYkP/gckoTZKcQotKkjmgkbU=; b=B9F2IA2axirDJl1yunL22HsU8y gFIfRvUYViknlzkWGoxx5BYPns0UC6gKBG2QoLSSLtzrZYE/i3KKws/oaS4EwMYKjID757hD/dMa9 hJpWEnSL+7oX9rt5SXgme4UyNdPtwKS2PZhtzeZDwrHm9BQ6cYUfhRIBopqnUz4euKVU=; Received: from mail-yb1-f171.google.com ([209.85.219.171]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.94.2) id 1o19h5-001bL8-JB for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Jun 2022 16:47:11 +0000 Received: by mail-yb1-f171.google.com with SMTP id v81so16218973ybe.0 for ; Tue, 14 Jun 2022 09:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XDk/gviZ4PTB0F4aeM/SYkP/gckoTZKcQotKkjmgkbU=; b=UVo7z7mq83OdvUMfv2zalYzpjivYTuojc8nrC14VtzHQxfO8kkrbOasAwYDGrmh0Kr TPWc0pt/+WTr1mK679VBnfsxfJSlmVDdvJ3irqhAxmkoAx4FZyftOa92c55uGWg46fGk TdeH+DwIPD6MdYHH/1Jk2bwZMF8Li/tN3dYF48d71K87UHk4aSTUsKGoVJ/WFX7QGdRI WUP6m+iWKKgwgI4iEZMZPYuix0X3vA0PE9jMY5DudkbQGiz+Y33Dbzk6rPJIk+Wro6vk D8eKjKUczvkIQmPIhuCy3K231YVzvYQ5+wSL6oRpyTUF/8ZI14KP36My6ida7g7SkjWH t5iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XDk/gviZ4PTB0F4aeM/SYkP/gckoTZKcQotKkjmgkbU=; b=l9NbLICzIt8tWG11swK6/3rp8Bn2htwjP+hmivXGm8qWAmv8K2m0XU30yVnWiyy3U7 wu0Ln+aE6McgMIqTuVTKSdcUTAgb14hyYwqA2rdK3SzdLoCEi/s9qemUGmyx5C+9eMeR UBT9QZxYkW9PmzoSOC3CckXSuvUa7112P3iYwVIbjwN3GNogsV2Cr32Vc1KCIBeSa4DD 4JsNWqeQUSYQy6DcB6qUJzUG8ftp+wq4CWWJB/XksstFL0CZ4HwL9LllhZI8Oa8z9L7w hRGoQPaWfPe2dOFwyS8IsSFlhFgwY4IH7zZH35u6Jn2x+nkSh6XZHlOdq0gDwft298MO DSoQ== X-Gm-Message-State: AJIora/+FxjGdsvzgK/oeCjsaiylZkpAFTw972lk/5CDhEyQqj+tzaBg hnANU4Qu61pCpTgnisIFhe8mWVrgU0TYBbTGqhM= X-Google-Smtp-Source: AGRyM1v5cuCGYw9RPYwQDmZWRztbN8i22S3AMOZQ1Zdps8kxiWn7B6Dux4ERGYj+6pPK+GABe7xiCvTpqdRn6UHJIaE= X-Received: by 2002:a25:4688:0:b0:664:68b5:e283 with SMTP id t130-20020a254688000000b0066468b5e283mr6098349yba.546.1655225221744; Tue, 14 Jun 2022 09:47:01 -0700 (PDT) MIME-Version: 1.0 References: <20220613155612.402297-1-daeho43@gmail.com> In-Reply-To: From: Daeho Jeong Date: Tue, 14 Jun 2022 09:46:50 -0700 Message-ID: To: Gao Xiang X-Headers-End: 1o19h5-001bL8-JB Subject: Re: [f2fs-dev] [PATCH] f2fs: handle decompress only post processing in softirq X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Eric Biggers , Nathan Huckleberry , kernel-team@android.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net > > Some my own previous thoughts about this strategy: > > - If we allocate all memory and map these before I/Os, all inflight I/Os > will keep such temporary pages all the time until decompression is > finished. In contrast, if we allocate or reuse such pages just before > decompression, it would minimize the memory footprints. > > I think it will impact the memory numbers at least on the very > low-ended devices with bslow storage. (I've seen f2fs has some big > mempool already) > > - Many compression algorithms are not suitable in the softirq contexts, > also I vaguely remembered if softirq context lasts for > 2ms, it will > push into ksoftirqd instead so it's actually another process context. > And it may delay other important interrupt handling. > > - Go back to the non-deterministic scheduling of workqueues. I guess it > may be just due to scheduling punishment due to a lot of CPU consuming > due to decompression before so the priority becomes low, but that is > just a pure guess. May be we need to use RT scheduling policy instead. > > At least with WQ_HIGHPRI for dm-verity at least, but I don't find > WQ_HIGHPRI mark for dm-verity. > > Thanks, > Gao Xiang I totally understand what you are worried about. However, in the real world, non-determinism from workqueues is more harsh than we expected. As you know, reading I/Os in the system are critical paths most of the time and now I/O variations with workqueue are too bad. I also think it's better that we have RT scheduling like things here. We could think about it more. Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel