Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1769995rbb; Mon, 26 Feb 2024 23:53:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVo5X9FO/dXaRmIcERHoF4ckEP7MzZmmJcgAhnp8w5Hu3OHrEWKWwA529CSwqcn12rXtNE+xzJdZrf0ayvh0byHrR4gl8CjVmxcuZg6EA== X-Google-Smtp-Source: AGHT+IGrKCxvwZ4bye7EZXKGehbaGbsOg9j4gSgJLyfmQmYOCQtztnt14J4FxUoioUj6DZc2nJbm X-Received: by 2002:a05:6870:65a5:b0:218:d374:9b7b with SMTP id fp37-20020a05687065a500b00218d3749b7bmr11370844oab.38.1709020399160; Mon, 26 Feb 2024 23:53:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709020399; cv=pass; d=google.com; s=arc-20160816; b=V48J6xP3+miech0X6Gb/14TxAQTJaBjUoNlU6GWuJsuPOOtDJ3eM05xm/UjahofiPM ta356wPE4/QKLVQnM4FiTnuoGcm7EnwA+Z8FV497whlUhiNQbPyldnyV3U0WoGLh/QFV 96uq5v3w4zjWOdocpH93Fhq+4Ez5lsWmap95fEzHORBD4a2KqE9mbZjSPYBFLc8iG4rb bhNlqDFJM2ytldSKkCH9tnEBCOHFCmDb5/RmrRrfkj9/4h9ldaVbUng1Xj2YGlVe9+mk qAvHYV9lqMak7M+ho8pYuF5tZAcOWw3tzvmWTYhGyWRoh8g+cmwhiYLlxlSPb53eaWva 8lOg== 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=ENJj/6O9DH4cxRE/TQEbtaKBpIfwOdtzioRhc7Nl6I8=; fh=e96AGRattc6s3QkBjkawG5wtotdueELllF2vVtJi4EY=; b=oKQ24Z0pUeQgTeY+FcBVih2yZflea23lalcfDd0JmCzyky9F8ZOj7p3YoLQIB39wYs FHkyUiBtDDBT6a/29/oZEr/hCxHgTPO6QDw6vkkbQCZGoZZJ6yTBa73jIt5NzprBzthx LZwwdpB/EFDppXQGo2AkebeijrApRCQjV8+hn7P3ELCpl0F4iTlrCj/mz8V/cJMPPEaK f3suAj5U3wXVZMWgqMf1u2skBxCbiQkmZuiQ6jJv1fFxRWfIZXWHqzKz1yEkNaBy8CsT ryfvlfWMOq0ZjQTwENcPu+YkVsOLH2MjcPpVnaDHd7I9DKu2V83qFLife4nJhJwHiDsR 745w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AEnNtpe2; 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-82830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x19-20020a056a00189300b006e5347c5abasi2482871pfh.330.2024.02.26.23.53.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 23:53:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=AEnNtpe2; 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-82830-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82830-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 803B6B22D23 for ; Tue, 27 Feb 2024 07:52:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4142954BCB; Tue, 27 Feb 2024 07:52:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="AEnNtpe2" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 F0CA555E5A for ; Tue, 27 Feb 2024 07:52:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709020336; cv=none; b=gyGgDliQSkTbq3sHYwS5Jb53cc/YKyPEKwE79z9RdGF3rJfaMvJCiH+F+TILH/Rm/txXaPKNKuxMkr0M5p0mrV/hv1DNlZcLTNFm6A+QCONorNq5B16SqZDAlWzceLPRRprgwrkS+ZK7A0dJ96QUynONsnm3BSWUiAomx4HKAp4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709020336; c=relaxed/simple; bh=9i5bdvauffTPJLJAtxK7D8dzjqmk1o8q6vh9OmqQgHY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nd9GVaGh7TLj6rwYK1uQnNlTstCWkfC7pKjc3Q+iyY2+RZkolaIPU0rjmNMqurlQSToJxaj69srzw96VEzMaOEO6EunZ/wy/Kl77yeDxpzDGY0wW+nBZP0t8z/fJVecdNdRJHmL9diIcdlODaTSvXj/cvg26zhYXFnLapCPV9QQ= 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=AEnNtpe2; arc=none smtp.client-ip=209.85.210.173 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-f173.google.com with SMTP id d2e1a72fcca58-6e54ffdd0b5so25800b3a.1 for ; Mon, 26 Feb 2024 23:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709020334; x=1709625134; 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=ENJj/6O9DH4cxRE/TQEbtaKBpIfwOdtzioRhc7Nl6I8=; b=AEnNtpe2p9wUfimLtrhNE0O5NILodGNRrUixx63KP9vqnPgmGOjZQ+GXBqpk9W9Y+X BB9K83vxGgmnh3tQACS4Z6PR98BFUYGe4XpG/xp1UG3RV8ULxl0eFdMq24Cr2uNw+O+n b8KGPO7R2a/XPS7zVfmjn3peJ/CdePSpVcIp8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709020334; x=1709625134; 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=ENJj/6O9DH4cxRE/TQEbtaKBpIfwOdtzioRhc7Nl6I8=; b=L1My/Q6oeRh+VPctjM2MEZxhZjA/GxMHY9Cm8t1gOmbL+VIIpxNaITui9U9x5VxHiD w9xGtwF80bHsE2XOXLClz/7MzRt/0CcBB1iSlxP/XL3BcxbHvFsaWvGccmwx6EHKDpsD Ho5r59RD8YLN9Ey5nz2WusZnURAvdlNrrgd6YTLzuJpkVL4lrbjJWtK0Awg46/jtzG2L nz8ljGTUqnz5nwUb6MJ9Xu5ZB24eBVDRfvIhxb29T6YaE7xIllLk1NrexiPMZHbAWd3S dAhKIjq393S1HnqQo40WmBGQn45cqgYktiLJjbB4SI65kf6Rkx4PaDuknzEfg8hpLomE HUdA== X-Forwarded-Encrypted: i=1; AJvYcCXmRsRgtIXdw7113PVeyQ84KKwUt0VZTs7YrHafr5LNqARQDXCqVW2VwF3JrWXV0zf9yql4ENei1Zd23bNVS9vdJA7COqUsayDYuOGy X-Gm-Message-State: AOJu0YzUv1TsNDTeiIgxUArYc7ahmPvbj6D1PMuJsu5azl4EKyeZgmHv eiDar1vnjKIryQ+EmyJIwMm13x7EDDog8VKxGmjDK1YFly47TKgDbRPaPZwfyg== X-Received: by 2002:a17:902:d4c3:b0:1dc:b6ef:e233 with SMTP id o3-20020a170902d4c300b001dcb6efe233mr1675638plg.50.1709020334115; Mon, 26 Feb 2024 23:52:14 -0800 (PST) Received: from google.com ([2401:fa00:8f:203:f4f0:fb4d:aa01:9068]) by smtp.gmail.com with ESMTPSA id i8-20020a17090332c800b001da2f9d04b0sm901544plr.15.2024.02.26.23.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 23:52:13 -0800 (PST) Date: Tue, 27 Feb 2024 16:52:09 +0900 From: Sergey Senozhatsky To: chengming.zhou@linux.dev Cc: minchan@kernel.org, senozhatsky@chromium.org, akpm@linux-foundation.org, hannes@cmpxchg.org, nphamcs@gmail.com, yosryahmed@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chengming Zhou Subject: Re: [PATCH] mm/zsmalloc: don't need to save tag bit in handle Message-ID: <20240227075209.GA11972@google.com> References: <20240227030045.3443702-1-chengming.zhou@linux.dev> 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: <20240227030045.3443702-1-chengming.zhou@linux.dev> On (24/02/27 03:00), chengming.zhou@linux.dev wrote: > > We only need to save the position (pfn + obj_idx) in the handle, don't > need to save tag bit in handle. So one more bit can be used as obj_idx. [..] > mm/zsmalloc: don't need to save tag bit in handle Does this mean "don't need to reserve LSB for tag"? We still save allocated tag in the handle, that's what handle |= OBJ_ALLOCATED_TAG; does. > Actually, the tag bit is only useful in zspage's memory space, to tell > if an object is allocated or not. I'm not completely sure if I follow this sentence.