From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752100AbeBZF6M (ORCPT ); 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 X-Google-Smtp-Source: AG47ELv2RZsJGwVS7fKVKn2UB2kFTuYU9maxO8LFUUALTO8f8Clyg8JlSPPWYQnC1/XbD88VBUi12A== 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 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()? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f71.google.com (mail-it0-f71.google.com [209.85.214.71]) by kanga.kvack.org (Postfix) with ESMTP id 77BD56B0005 for ; Mon, 26 Feb 2018 00:58:11 -0500 (EST) Received: by mail-it0-f71.google.com with SMTP id l140so8081764ita.2 for ; Sun, 25 Feb 2018 21:58:11 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v7sor3761114iod.116.2018.02.25.21.58.10 for (Google Transport Security); Sun, 25 Feb 2018 21:58:10 -0800 (PST) Date: Mon, 26 Feb 2018 14:58:04 +0900 From: Minchan Kim 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> Sender: owner-linux-mm@kvack.org List-ID: To: Sergey Senozhatsky Cc: Andrew Morton , Mike Rapoport , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky 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()? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org