Received: by 10.223.176.5 with SMTP id f5csp270970wra; Thu, 8 Feb 2018 21:37:31 -0800 (PST) X-Google-Smtp-Source: AH8x2262r+FAz66zIeFu24BUuZwdER94Z147z8vMmjZO2rF72wPeBZHIq5ZOSmEoiUOHexHc3PAq X-Received: by 2002:a17:902:968b:: with SMTP id n11-v6mr1462772plp.168.1518154651168; Thu, 08 Feb 2018 21:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518154651; cv=none; d=google.com; s=arc-20160816; b=t3aXs1qojrr3KOCOimQ7oOrICGxxvYeBnCr5QH/P3qJYn0AYy61yWqpFiYpBTi+e8i BKSD1tgrPAS8TK3YibvEwNFonMG0iIqsKZdjPF6Z4m5sPV010ERxZMHjWHG/Y9e+Rptk /btZPR8JLdFf4f2zcaKtNzXNsJaETEQ8u4NzRNsq1a/XUeZGrja8KNTPOf9DR9g6Fy05 zUOxsPsX1UZwR1SFrhRYMaD3vBZVM+oEZCPt9ExPojfFakFJ/MUncpBachiRwSpx1o1E uqVIlJKO8pg/f21bjNGXTA07/HnVFzt5wKVM6yWEkS7xWqdqsALhbYeUDR/ueNBbFDOe cizA== 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=aidclmdkisFyoR1dN4AJo0uG8E6V+3Lb95Y6nO8Ptbc=; b=l90zENPb0KcF6ZXWg4QR9ufJDMP3LQGRdFGxuuaEPKAY/J2TTPBySEmneUvQ3DIb4D iqVWO5TSHDS3gSLTJseAFojATQvtjvyeJV3iq5xkDGTk7TsTqZYPE1iRKSdx/zQ7/ivO U2YDaYcGYQd6WOdtCdAu7G4OWPdTETb93hsC+GRLn+PAgAGC8QN8mABiWnomTUZ+rihJ 8OaPVLmmBgZFt3Jy4rYNy2AItuUBztUoGBdL7T++D3NV41puLtIQPd06SM6Jgr49wPKT +vTWS8RfiQg+2mzDSWpjVgK5RXfeFYAXG89NYdgfUC2BsPi/63ojo9AA7JYHDjL2/89e aNdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c/H3rOt6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b89si1194257pfk.163.2018.02.08.21.37.16; Thu, 08 Feb 2018 21:37:31 -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=pass header.i=@gmail.com header.s=20161025 header.b=c/H3rOt6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750919AbeBIFgg (ORCPT + 99 others); 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 Received: by mail-pg0-f67.google.com with SMTP id a11so2924053pgu.13 for ; Thu, 08 Feb 2018 21:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aidclmdkisFyoR1dN4AJo0uG8E6V+3Lb95Y6nO8Ptbc=; b=c/H3rOt6zXU2sMx/z4PqBStI8KZJkgEXmCH7Ndv4a4t2Wl7gOiuubTuITrngKu6g68 UT1404zOSU4i841P87nW33m65yk2JUU6c+uLrIC2ba6zpjkN8L42dGbTRyaFghkptdxR 8WIhK3HeoXMfmwhqT8GPhg+FJXauw2hbGbGXFtNuPjwrcSELrpTtJMx4UkMe+m4Rf9DA G/oxZCAsLNGciD8GZt0YgohIokJIAXOMt0/wUQ2+54LXA2Yh3EeVe+BC1EhBl2flXDO4 YiGLq03VcP2FJnOlDxM44XxyjxrEUMx3C1rxZb0/+Afm50z07ryU+VknX556ZZOY8Hqk xcyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aidclmdkisFyoR1dN4AJo0uG8E6V+3Lb95Y6nO8Ptbc=; b=Af11Y6uYRAfEYFVxDEfuoqz0hEfCGwTvUZbDA454qAOQgD1/ub/09Uq91vu+x35HWF cIo0jE3yqhD5J9JGGaIZYyFj1oSJBL/o1GdBrbxslg+qsarjA5bnJu7tPue/yGNgov7J XjE21povV/kb3yr3D7fboE65ywJJNTnnBcR1+Ex+yOKPtePClo4+warx2DCpQc14C27b Ntd2FYfDkJKPrCe7g54MLz4/SFWHxxuP91RyV/9hHkmV1UldGN0jJMvV/9ZistOeOuQR CeBZgZWyUGNt3lJaUhYRUnadkwQSCDPnF9LGnpzQajKniHII/3u4LaR6AVXkkmOt8r+C RAvw== X-Gm-Message-State: APf1xPBQIH2gBY2I3q8EqoHfD5ZXr0coXIgWlqm+zkB5gcH30WVf1Mrh dyQ4P9GyLqVtqERT1RCVSWQ= X-Received: by 10.99.160.2 with SMTP id r2mr1412640pge.426.1518154594716; Thu, 08 Feb 2018 21:36:34 -0800 (PST) Received: from localhost ([110.70.51.39]) by smtp.gmail.com with ESMTPSA id m65sm4004991pfc.150.2018.02.08.21.36.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2018 21:36:33 -0800 (PST) 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 Precedence: bulk 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