Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp249964lqh; Fri, 3 May 2024 23:02:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDJ4cgxGW5BQbYMGbyu2nm0jplAQlWFckebnz4o4D2fjAsn0IDiwAWaueaTk9iXjWBN7hPuN4cFhz78pOCskTUaEUJOMiI14H72WTPjw== X-Google-Smtp-Source: AGHT+IHUC5lnxKlZHcE1dLCZBXtzNww2+L3HkQTV/BrLqdxY4dJTgTaEPnEoCxfGhoQ3VNMs6L8n X-Received: by 2002:ad4:4eeb:0:b0:6a0:48c3:52ac with SMTP id dv11-20020ad44eeb000000b006a048c352acmr4810570qvb.45.1714802547145; Fri, 03 May 2024 23:02:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714802547; cv=pass; d=google.com; s=arc-20160816; b=z4UIbT2+SdWJDzNgoQn8FdyG4EEEJdRXz/Yamhabfnrq71/xsTpD0Imd0M4dYAYZ/e RpP28+W2PSxJhaD1XHjJyLEEsziW43JlrdmPZIWMwFf4IGF4W6tm+9M/D+ZNVlE9hRhk weoEM9+u8rPWbz9PiU98jQY6bncMfPE+BVwipkmqhRt0XjhmP7G3crJx8Z7FgMNxBVXd +Ru5zlXWsqQIzB17VL57sy5muJR/g17JdIEn0x9VVYNI2u+XpkAClfTKjWm3utHXTdgK 2Rey8WJ/FlXSfyRVE5ljj6OReXW74lbUgxJzdBhChHzYDaMejJCgf9B3TgYO3WEMnWu3 LZKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qRvyWG41PYoYuhLyhTnYN9G8n9dRpCEoa0AKDj0Jn1g=; fh=x4p6RguovsQYAtr+mlaG8KbuuUbtPUSzboh/19pg/j8=; b=K99N76Nq7zmFYxoNqn5dVRqfY5UouTvvM7+73c7yfx3x7V/TuzhBweQXWCHFFGwjQi VIyzKxqIU2Z/e4bFf7WU90hNxzAHqiXHzg8L4KjTqWzmtvw8hk0VGTFPrfuY7eC2MnjK ZXybfg7fKzwD65V9kw+Xz87vkpyP2df0iXBSvfbG344AJ7pc8gsWTG6DPYB9TswZ8NPa oVFVApF/ADYcHWD6KhqAF16XSTxpZWWXycE7m0YduiAq/ctT7vJwBr1P8dFP1z+SwTmP mn/S9MqV2WPz5xXpLhy/vkhYpCYgSB6uaZTarOZZt84dUno1XhUtOFbxhr1mHXaK7Y5p i11w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EWuRQ51a; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-168525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168525-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jl5-20020ad45e85000000b006a0ce3e7f32si4926005qvb.543.2024.05.03.23.02.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 23:02:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EWuRQ51a; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-168525-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168525-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DAE4D1C21478 for ; Sat, 4 May 2024 06:02:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 026AD46AF; Sat, 4 May 2024 06:02:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="EWuRQ51a" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82480291E for ; Sat, 4 May 2024 06:02:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714802538; cv=none; b=lj/ZsgRvveRPusgRAPvKwO1UsFvPFmqoilruCFAJsm+2xO2QTAqxui+S5TIdMsc3QDLbtx3yb0oXSDoJyB4ANPV3OGngffr6fnWEfM9Cj7keTpLh+ZTg7aPmA/0ciKniel4SYrBq3bd2Dk4UMQJOcuFkraCvhdi4KGVinKDgy24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714802538; c=relaxed/simple; bh=QNxdE8XEnHl6uXZt8I1uundZI1OzA1eNbsJ07NtLMy8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KNdexWyLCtNTE9y5+JEFOZbrvTQpqfNpP64LS01vw6lKjSgNcuxsap8l7/D8NnOH3nwyF142ckfa5qWxxMhvQKx9gJ3pMTuT1/hp1jN/bLxc0z1KVLVKsvx1a/iB9YIVfbGWYlteYEy85dWMSumdKDe7pZ/WyZjMaWvKTTIi54U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=EWuRQ51a; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6f45f1179c3so55044b3a.3 for ; Fri, 03 May 2024 23:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714802536; x=1715407336; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qRvyWG41PYoYuhLyhTnYN9G8n9dRpCEoa0AKDj0Jn1g=; b=EWuRQ51awUZFbsXgacY4XdeoDVjexcBZ0AiO0ZG4XiKxw8X/znsMnObrCFuclS6uu4 witwJsrzfupeALVjpbgTDRsWOTDWOgNPdnYy27GlcVoq88EJ9Ra9rDw0zr4wQlNTNd4M AO4IeaHxauCls9ujQB2oMx7kI8e+X9EVHtggM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714802536; x=1715407336; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qRvyWG41PYoYuhLyhTnYN9G8n9dRpCEoa0AKDj0Jn1g=; b=fJtZ/1aXH06nsjWDcyilOoN+ssiDydcf04p1fSjd+fhI8nXWTSkLKAgisim2Urd6kJ JSmO0k/NkQ//8MZDJrntMbHOSjUJlHvTIf6J1u/ucDa+EVd77a67757s3ryPKp6yxu5X ZpoW59B4JOCKYHKv+/XKPsnM+sjK2hsLVhAdFvutRl0mqtDMjaaYP0F+Mm6JMMlFeSF6 mGYZ3c88PmqjRWKroJB4PQsZo1sZLsvdqPOfNK75nkk2sey00Xa5lA+Qm52mKnP4NALq rIU4FroRP3Hhd+pGlbQuRYHkjJ/s80tumGq9ZaAH2vF/OE3HdRrkzkpAB4q8ZIEOpD3q ewBA== X-Forwarded-Encrypted: i=1; AJvYcCW3szjzk2cSkwc6WtxZgnwBoOxRYIsvg1tonN2iMCfBRn0KaMe4vMFjDrf0apOdrH1uPDp66zy3FlgrIFwx9Qvzam+FU770ESpjMavb X-Gm-Message-State: AOJu0YzAl9sCpn/Ndg4jcvP3FWedeUaimBFjLCyUgOqbmz19mdz8sCQE qae76ucD+IOwznsbkjVAUy72vpMJGFtr2Q4j/CZmpEL3I7u+GSibalYauI8T+Q== X-Received: by 2002:a05:6a00:2316:b0:6e6:ac71:8b38 with SMTP id h22-20020a056a00231600b006e6ac718b38mr4920802pfh.22.1714802535870; Fri, 03 May 2024 23:02:15 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:a616:7211:d0ce:9ad9]) by smtp.gmail.com with ESMTPSA id a1-20020aa78e81000000b006f454a607d6sm1118488pfr.148.2024.05.03.23.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 23:02:15 -0700 (PDT) Date: Sat, 4 May 2024 15:02:11 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Cc: Andrew Morton , Minchan Kim , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 13/14] zram: add dictionary support to zstd backend Message-ID: <20240504060211.GG14947@google.com> References: <20240503091823.3616962-1-senozhatsky@chromium.org> <20240503091823.3616962-14-senozhatsky@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240503091823.3616962-14-senozhatsky@chromium.org> On (24/05/03 18:17), Sergey Senozhatsky wrote: > This adds support for pre-trained zstd dictionaries [1] > Dictionary is loaded once (per-config) and then loaded to Cctx > and Dctx by reference, so we don't allocate extra memory. > > The patch is a little non-trivial, as it seems that noone > ever attempted to use dictionaries in the linux kernel > port of zstd. > > It also uses GFP_KERNEL gfp in Cctx customAlloc(). We probably > would want to do something about it. Either make sure that we > always (somehow) fully setup all Cctx contexts from non-atomic > context before we attempt to use them, come up with some sort > of custom allocator or stop calling zcomp_compress() from atomic > context. > > [1] https://github.com/facebook/zstd/blob/dev/programs/zstd.1.md#dictionary-builder JFI I reworked this patch quite significantly in v2 of the series. I guess I'll post it soon.