Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3986688ybc; Thu, 21 Nov 2019 17:25:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyz1BFlPGxf5NdFN8o6NC42mv7Igqrqi/l0n+iEsY/Ro70Y3Yhoqtdj3QZ16dfLnDBHEKqG X-Received: by 2002:a17:906:1c59:: with SMTP id l25mr17854437ejg.98.1574385914886; Thu, 21 Nov 2019 17:25:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574385914; cv=none; d=google.com; s=arc-20160816; b=GdeXpusFGlGNxSHB9bYRZ/xPDAsiAiWNXcXypLcs+8bh2d2Eo7EvWRSfdcDFvT+aAo zzbHZQP+H9MEdbqFFrs5XfR6mNYyEtTyHe8Z6UkB86DrIuZOK05WrOKEDapVDvcEHCJ9 tklvwnLx9zMueKW5SLtcpHal0bmTAMqBDx9wY9bokF/2WxQfGmFjHZhf4eFeMux7K/Zd iOe7uVA5m1rOIaFSTNlKcPVM50HZDsqDgjaZsDqnbWdVJCnbhknSDhTjwyplzYVB7chr qAhB7a5/GUE+syDjXtG7pQGlpSJEEmJ4WqIk56WBa27HBsG1W2wTbr/L8z49hEV1gXJi Bn1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=KG+NQm/Fq4RZQUHdNqlpf5Tb5rToJmtns2F3FDHBMlY=; b=hHN9oR0x02OEOLXzShxu1+43YVvEJTZgz4hf5A/Z11zOXfAvPCRsa5g3881mWJphjL 6E01LjZTTqpQeAEHMtcDaFfoRjDkBzdZzyTb3moc2o+JM+WbrISthOIeFKqvq08UND8U /vUDLY/+jejhoAxdj6U83wcRjxGFQ53qKmN/6LqU3ku22BZy4yDMAA3U/oXjw1VyKHw7 O4rh6t131wy6JuGVSEPaimrmqu4qMxHov00AiXClbkFrPB9oiqiclpvZp+OwGY+R/vWB +kE4eJYJXPrEL0g4idutrEnjnU99qPVQZ9qeVsRclQbG6nkHiHAj1MU9TSc9F0CR15+6 Brdg== ARC-Authentication-Results: i=1; mx.google.com; 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 j10si3530376edq.394.2019.11.21.17.24.48; Thu, 21 Nov 2019 17:25:14 -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; 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 S1726510AbfKVBXk (ORCPT + 99 others); Thu, 21 Nov 2019 20:23:40 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7162 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726265AbfKVBXk (ORCPT ); Thu, 21 Nov 2019 20:23:40 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D9A5B40ED3F3102114FE; Fri, 22 Nov 2019 09:23:38 +0800 (CST) Received: from [127.0.0.1] (10.184.213.217) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Fri, 22 Nov 2019 09:23:32 +0800 Subject: Re: [PATCH] tmpfs: use ida to get inode number To: Hugh Dickins CC: Matthew Wilcox , , , , , , "J. R. Okajima" References: <1574259798-144561-1-git-send-email-zhengbin13@huawei.com> <20191120154552.GS20752@bombadil.infradead.org> <1c64e7c2-6460-49cf-6db0-ec5f5f7e09c4@huawei.com> From: "zhengbin (A)" Message-ID: <5423a199-eefb-0a02-6e86-1f6210939c11@huawei.com> Date: Fri, 22 Nov 2019 09:23:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.184.213.217] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/11/22 3:53, Hugh Dickins wrote: > On Thu, 21 Nov 2019, zhengbin (A) wrote: >> On 2019/11/21 12:52, Hugh Dickins wrote: >>> Just a rushed FYI without looking at your patch or comments. >>> >>> Internally (in Google) we do rely on good tmpfs inode numbers more >>> than on those of other get_next_ino() filesystems, and carry a patch >>> to mm/shmem.c for it to use 64-bit inode numbers (and separate inode >>> number space for each superblock) - essentially, >>> >>> ino = sbinfo->next_ino++; >>> /* Avoid 0 in the low 32 bits: might appear deleted */ >>> if (unlikely((unsigned int)ino == 0)) >>> ino = sbinfo->next_ino++; >>> >>> Which I think would be faster, and need less memory, than IDA. >>> But whether that is of general interest, or of interest to you, >>> depends upon how prevalent 32-bit executables built without >>> __FILE_OFFSET_BITS=64 still are these days. >> So how google think about this? inode number > 32-bit, but 32-bit executables >> cat not handle this? > Google is free to limit what executables are run on its machines, > and how they are built, so little problem here. > > A general-purpose 32-bit Linux distribution does not have that freedom, > does not want to limit what the user runs. But I thought that by now > they (and all serious users of 32-bit systems) were building their own > executables with _FILE_OFFSET_BITS=64 (I was too generous with the > underscores yesterday); and I thought that defined __USE_FILE_OFFSET64, > and that typedef'd ino_t to be __ino64_t. And the 32-bit kernel would > have __ARCH_WANT_STAT64, which delivers st_ino as unsigned long long. > > So I thought that a modern, professional 32-bit executable would be > dealing in 64-bit inode numbers anyway. But I am not a system builder, > so perhaps I'm being naive. And of course some users may have to support > some old userspace, or apps that assign inode numbers to "int" or "long" > or whatever. I have no insight into the extent of that problem. So how to solve this problem? 1. tmpfs use ida or other data structure 2. tmpfs use 64-bit, each superblock a inode number space 3. do not do anything, If somebody hits this bug, let them solve for themselves 4. (last_ino change to 64-bit)get_next_ino -->other filesystems will be ok, but it was rejected before > > Hugh > > . >