Received: by 10.223.185.116 with SMTP id b49csp3390618wrg; Sun, 25 Feb 2018 21:59:24 -0800 (PST) X-Google-Smtp-Source: AH8x2267boA4ElETNPB98q2L6yQPF24LsolrgFDuECcCLvsd/xoh3N1cCNHdlOQB2dCwjTGRdUZh X-Received: by 2002:a17:902:b210:: with SMTP id t16-v6mr9468866plr.373.1519624764612; Sun, 25 Feb 2018 21:59:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519624764; cv=none; d=google.com; s=arc-20160816; b=gHG/6dVPzWDcdthWnjFdjva3qZ9DwXxHcTd28PvVNKFkvGbsFjG84dQr+imJQ0Pt7j tKgaCS4Uvk71fz9J1d6lQOcHXGvn+sikECkXN1/04sXQ/DYBdQWN0ujpcNQIzCUrL+cl sxb9IZegX9UTRZcV3mTQC9nLgkQBxPzV0b6bg1bkWn47HKsSEvNod3V97SZOzfOJ0CNs QHIpQXn64s7CnCeOUJ/Rvi18fBpNcFNw4hWB0qaOF+buMF1uiUXx4ue36eChY49+jTRD AReOHeSKVHPCHgrTOpPWySsvLm286BSSt01S4hO8VjzDE7Q15ShaMW7Z+Gfq0y3G7kVL CpKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=1VGcX4OXXSoFpLTQXsRlbT/CBGSw7FXCT/lRVtZOLEc=; b=g6dgJd/P8+MxtAGRi1ya29YMamGS9OdxG0tHYNM8Xjaezdjzq5fkYnQX42aaIKovdl c8sJ+gQprilKgxPLd4yEbDJ/lqwFN8pZVyfvDbg0ZZ/EL1y290hrmCqgzGKqvlnBnlQB wt746++AnE5GIGo0zJYcI5aLz3mnSukXvoqoImbhWMmT7u2+to53CvGF3Wgv1uULZ3He fBKLw/+Cr3CiOKwwatCvO7OSHy6CzmWVp5YutItgvyPrPpYzYGEqtS5qN787y1Os+1YC eDJsf+DEAq9flbcroRqMr/e4DOaNUFq+Wq36kgxaMr/PZpH+LlUlcGa/0uXc0Ekb3Sq/ 23Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=f0HVPGaH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si6254243pfk.26.2018.02.25.21.59.10; Sun, 25 Feb 2018 21:59:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=f0HVPGaH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093AbeBZF6M (ORCPT + 99 others); Mon, 26 Feb 2018 00:58:12 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:34599 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbeBZF6L (ORCPT ); Mon, 26 Feb 2018 00:58:11 -0500 Received: by mail-io0-f193.google.com with SMTP id e7so15962860ioj.1 for ; Sun, 25 Feb 2018 21:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1VGcX4OXXSoFpLTQXsRlbT/CBGSw7FXCT/lRVtZOLEc=; b=f0HVPGaHNrBZwqax59MgOdoli4oXqZe5RMNo0cwPE1mc7cR22DRx53jjAFF5Fovd5B krJ4uX1NWEmgZjgTQOYqO8Q8Lab0DnLktV1sbOVqWO/NnAXs8bpqDpH1CZrQ2c/FXd5h ZQvoa5cW0BUe4Lsui3lQa0K+yRAGPB1KzdgpFyLtX2uflyVcIqqQZ/yKF0ixFvTc/th1 p6RIWvqL9KxepmBLwfNMprwMXvx4SUrKSUqGwr17sA8wipH713+z7QulsXSPa3rdeuTx icTYvwfXHfCItID0GwtcEjr7kEW9AwQhHtnf8OMbMPI6XaaPmXFXo6AHlf8QAnH3QRpr f9pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=1VGcX4OXXSoFpLTQXsRlbT/CBGSw7FXCT/lRVtZOLEc=; b=JyYaRqsn4ql8vofn55mZZ99LUwivHSKBp3e05uGQhATd8pmrD96rVJYyaa24jrg6/K 2uJTLrH9m1+B2c/kdEpfQv/ALe90gRS4V3SQvVEwM+RVQoLN/mRKNyyYTGTWFaNBIHr5 a2T1A1O+xBYmi1sE3APxIkvrk00aLHDGyYe0Vq706DhvE99i+T79H2GpfPYEevmFX+uq QvN8lKMib9oitTinLjYpGoU8ol9EAM+m+JQQoL+pBZiwTYukvAMCxDZjAjkoFN0cVmlb +IVNVcw3/phNIMv7VCUXpONRdPEErsY/BEbNFfsS85ocWr8sZTiMKnlW+u3nWN0MbUyb zdpg== X-Gm-Message-State: APf1xPAwHXKfHAUD906xWgAjM1uqQBmBTBwxOCihRhx7SyQyXXCIIdYC A3cXxr07GF3v0fRKdf+l80o= X-Received: by 10.107.132.18 with SMTP id g18mr10832348iod.46.1519624690295; Sun, 25 Feb 2018 21:58:10 -0800 (PST) Received: from rodete-desktop-imager.corp.google.com ([172.30.114.13]) by smtp.gmail.com with ESMTPSA id z133sm4936299itb.2.2018.02.25.21.58.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2018 21:58:08 -0800 (PST) Date: Mon, 26 Feb 2018 14:58:04 +0900 From: Minchan Kim To: Sergey Senozhatsky Cc: Andrew Morton , Mike Rapoport , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: Re: [PATCHv3 1/2] zsmalloc: introduce zs_huge_object() function Message-ID: <20180226055804.GD112402@rodete-desktop-imager.corp.google.com> References: <20180210082321.17798-1-sergey.senozhatsky@gmail.com> <20180214055747.8420-1-sergey.senozhatsky@gmail.com> <20180220012429.GA186771@rodete-desktop-imager.corp.google.com> <20180226054927.GA12539@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180226054927.GA12539@jagdpanzerIV> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sergey, On Mon, Feb 26, 2018 at 02:49:27PM +0900, Sergey Senozhatsky wrote: > > I think it's simple enough. :) > > Right. The changes are pretty trivial, that's why I kept then in > 2 simple patches. Besides, I didn't want to mix zsmalloc and zram > changes. As I said earlier, it's not thing we usually do, at least, MM. Anyway, I don't want to insist on it because it depends each person's point of view what's the better for review, git-bisect. > > > Can't zram ask to zsmalloc about what size is for hugeobject from? > > With that, zram can save the wartermark in itself and use it. > > What I mean is as follows, > > > > zram: > > size_t huge_size = _zs_huge_object(pool); > > .. > > .. > > if (comp_size >= huge_size) > > memcpy(dst, src, 4K); > > Yes, can do. My plan was to keep it completely internally to zsmalloc. > Who knows, it might become smart enough one day to do something more > than just size comparison. Any reason you used that leading underscore Let's do that in future if someone want it. :) > in _zs_huge_object()? Nope. It's just typo. Let's think better name. How about using zs_huge_size()?