Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5057555ybv; Mon, 17 Feb 2020 11:19:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzPhpW1xThvZf3l0Fwyt9EneEKbxlmAqre5SdZkOI4F6DPRD9xN9LgsY4bnT+D4RHqi0tAy X-Received: by 2002:aca:ab52:: with SMTP id u79mr293660oie.145.1581967179584; Mon, 17 Feb 2020 11:19:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581967179; cv=none; d=google.com; s=arc-20160816; b=eKkhfeDyab0txRaeAZj5fLAbtwZvLPsmUh2+4VVeX/dz/FFAEi7updvR4+w5Ff6mLf FRnLoNDxrKqbqJtTqB7nN6licXQtWEO3E6Um3o/KYFcqRgdrqL9ctZocM7Utq4K3/Xr0 Sj4p6BhVo0LUFVb/EvSHsrix5ps6DoIbEADQdlGwwqAypi4CwM78Y/MD5t9Ly588PNuq xE4i9fUOGtAaiiEoSDUIIVzhqA2Um2qtkh/8U9KVaZK1L2tFh9H1BWEhUlF93UGqpGwC lEYHd4evZt4LAhKjk3iG8FG9UR5bDcDdb+W7wRGniWI5/obBCP1/7V3/Fw7cOfcG3RV7 9gUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:subject:cc:to:from; bh=U+wgOs3/EW8oMDpazz3dppykZCPquf7P3wzczmVj3vU=; b=OHHpNppmFYsgIl5J0pjFtSw6FjPnSB2jIIHlEgz4G1WmjK1ilgzVAnCPdX/zUowvaO n8SDTeUj7bJyeRyTmi8eCFssWT1xQ5VxDDRrQYZVmn9ZfmlLpfH78bLcylx4ZLVzlAOp K+txyTLrUU3mJftTwvN/v1aXqth7d6RtE0Ij0EnSWzNGDnta2ZGTpHFLiTHUu2qmjd4b 2X9bymhWD8qj4rTXMPKryiziDnlyREnSFtFoXr21czyf2KS5VprYOKj1NAH12QJP8QcX +Ppm6gGcAXfUJTCmojbQjBlXsOjrQ30xbmCYcbfaE0MUFQ3jojL3Ev/MHqw3ojSw13BR 6ckQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si663977otn.117.2020.02.17.11.19.16; Mon, 17 Feb 2020 11:19:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728810AbgBQTCT (ORCPT + 99 others); Mon, 17 Feb 2020 14:02:19 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43516 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728728AbgBQTCT (ORCPT ); Mon, 17 Feb 2020 14:02:19 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id A833F292457 From: Gabriel Krisman Bertazi To: Daniel Rosenberg Cc: Eric Biggers , "Theodore Ts'o" , linux-ext4@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, Alexander Viro , Richard Weinberger , linux-mtd@lists.infradead.org, Andreas Dilger , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v7 1/8] unicode: Add utf8_casefold_iter Organization: Collabora References: <20200208013552.241832-1-drosen@google.com> <20200208013552.241832-2-drosen@google.com> <20200212033800.GC870@sol.localdomain> Date: Mon, 17 Feb 2020 14:02:10 -0500 In-Reply-To: (Daniel Rosenberg's message of "Fri, 14 Feb 2020 13:47:37 -0800") Message-ID: <8536b95971.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Daniel Rosenberg writes: > On Tue, Feb 11, 2020 at 7:38 PM Eric Biggers wrote: >> >> Indirect function calls are expensive these days for various reasons, including >> Spectre mitigations and CFI. Are you sure it's okay from a performance >> perspective to make an indirect call for every byte of the pathname? >> >> > +typedef int (*utf8_itr_actor_t)(struct utf8_itr_context *, int byte, int pos); >> >> The byte argument probably should be 'u8', to avoid confusion about whether it's >> a byte or a Unicode codepoint. >> just for the record, we use int utf8byte because it can fail error codes, but that is not the case here. It should be u8. > > Gabriel, what do you think here? I could change it to either exposing > the things necessary to do the hashing in libfs, or instead of the > general purpose iterator, just have a hash function inside of unicode > that will compute the hash given a seed value. Sorry for the delay, I'm away on a long vacation and intentionally staying away from my laptop :) Eric has a very good point, if not prohibitively, it is unnecessarily expensive for a hot path. Why not expose utf8ncursor and utf8byte to libfs and implement the hash in libfs? -- Gabriel Krisman Bertazi