From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750933AbeBIFgg (ORCPT ); Fri, 9 Feb 2018 00:36:36 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:46380 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeBIFgf (ORCPT ); Fri, 9 Feb 2018 00:36:35 -0500 X-Google-Smtp-Source: AH8x225UBRtssI7d20NlErX/ihtWUrMmGon1H1aT9ysU5afcEaOo5ABr+LCp579hZU7Z8wQHAQO6qg== Date: Fri, 9 Feb 2018 14:36:30 +0900 From: Sergey Senozhatsky To: Matthew Wilcox Cc: Sergey Senozhatsky , Mike Rapoport , Minchan Kim , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: Re: [PATCH 1/2] zsmalloc: introduce zs_huge_object() function Message-ID: <20180209053630.GC689@jagdpanzerIV> References: <20180207092919.19696-1-sergey.senozhatsky@gmail.com> <20180207092919.19696-2-sergey.senozhatsky@gmail.com> <20180208163006.GB17354@rapoport-lnx> <20180209025520.GA3423@jagdpanzerIV> <20180209041046.GB23828@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180209041046.GB23828@bombadil.infradead.org> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (02/08/18 20:10), Matthew Wilcox wrote: [..] > Examples:: > > * Context: Any context. > * Context: Any context. Takes and releases the RCU lock. > * Context: Any context. Expects to be held by caller. > * Context: Process context. May sleep if @gfp flags permit. > * Context: Process context. Takes and releases . > * Context: Softirq or process context. Takes and releases , BH-safe. > * Context: Interrupt context. I assume that spelling serves as a placeholder and should be replaced with a lock name in a real comment. E.g. Takes and releases audit_cmd_mutex. or should it actually be Takes and releases . So below is zs_huge_object() documentation I came up with: --- +/** + * zs_huge_object() - Test if a compressed object's size is too big for normal + * zspool classes and it will be stored in a huge class. + * @sz: Size in bytes of the compressed object. + * + * The functions checks if the object's size falls into huge_class area. + * We must take ZS_HANDLE_SIZE into account and test the actual size we + * are going to use up, because zs_malloc() unconditionally adds the + * handle size before it performs size_class lookup. + * + * Context: Any context. + * + * Return: + * * true - The object's size is too big, it will be stored in a huge class. + * * false - The object will be store in normal zspool classes. + */ --- looks OK? -ss From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id 667A46B0005 for ; Fri, 9 Feb 2018 00:36:36 -0500 (EST) Received: by mail-pl0-f71.google.com with SMTP id j3so1396931pld.0 for ; Thu, 08 Feb 2018 21:36:36 -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 o21sor372392pgv.82.2018.02.08.21.36.34 for (Google Transport Security); Thu, 08 Feb 2018 21:36:35 -0800 (PST) Date: Fri, 9 Feb 2018 14:36:30 +0900 From: Sergey Senozhatsky Subject: Re: [PATCH 1/2] zsmalloc: introduce zs_huge_object() function Message-ID: <20180209053630.GC689@jagdpanzerIV> References: <20180207092919.19696-1-sergey.senozhatsky@gmail.com> <20180207092919.19696-2-sergey.senozhatsky@gmail.com> <20180208163006.GB17354@rapoport-lnx> <20180209025520.GA3423@jagdpanzerIV> <20180209041046.GB23828@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180209041046.GB23828@bombadil.infradead.org> Sender: owner-linux-mm@kvack.org List-ID: To: Matthew Wilcox Cc: Sergey Senozhatsky , Mike Rapoport , Minchan Kim , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky On (02/08/18 20:10), Matthew Wilcox wrote: [..] > Examples:: > > * Context: Any context. > * Context: Any context. Takes and releases the RCU lock. > * Context: Any context. Expects to be held by caller. > * Context: Process context. May sleep if @gfp flags permit. > * Context: Process context. Takes and releases . > * Context: Softirq or process context. Takes and releases , BH-safe. > * Context: Interrupt context. I assume that spelling serves as a placeholder and should be replaced with a lock name in a real comment. E.g. Takes and releases audit_cmd_mutex. or should it actually be Takes and releases . So below is zs_huge_object() documentation I came up with: --- +/** + * zs_huge_object() - Test if a compressed object's size is too big for normal + * zspool classes and it will be stored in a huge class. + * @sz: Size in bytes of the compressed object. + * + * The functions checks if the object's size falls into huge_class area. + * We must take ZS_HANDLE_SIZE into account and test the actual size we + * are going to use up, because zs_malloc() unconditionally adds the + * handle size before it performs size_class lookup. + * + * Context: Any context. + * + * Return: + * * true - The object's size is too big, it will be stored in a huge class. + * * false - The object will be store in normal zspool classes. + */ --- looks OK? -ss -- 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