From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DB173A783B for ; Mon, 30 Mar 2026 09:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774864746; cv=none; b=u10+nLGIM/C5TedDiTSrHZ0Tduwg3+jSNqZGqQyZF2ash7Cr5hqTOJSndyKgiz17OcAUQxmjoELJ07p7SNQK1JDRRL3L8qbBJNIiz9V9KdC60yeJQie9z4VVkV7LOupWc0p8cdVJCwH/BKT8RVGuuOHtLWCAux9gfqgKjnq2nPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774864746; c=relaxed/simple; bh=/+x3NIpg89NdgGwjYj/Ur6/xfp7eg+l3YHCpEql0vXo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ob5T8xFzxDIhKNWpSScj+N2MxsksXozOycPfSilh4mhkU9zG3DQcIdNbYqtkFRNjbfLYeBrE0RxYX/XW6zhfDjuczUe4jnv1BeD/yYnxjReXESY9EbyfO24sMFjQmr6DBOTg1jcsb9b3FRi12RUYkIKLfckA3h7FaOjbWJRLxyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cs/h6JLE; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=tBTD0iRj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cs/h6JLE"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="tBTD0iRj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774864744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ol467QNmt0DQ6eYz8EW6+Q+7C35Qnp9U6TLS9yRvFHw=; b=cs/h6JLErjC5s5jMcdvMGguwKsYgcan1uH+E5rx6H04RSZts46LnmhRC88WxtCSvCv9aRP HeO/6+VWJ7fKvkd9Ve08Rx8bJ3rw2Jaa7Pxd6KeotcR/x2Atj07HTJ21d01yazdBewCvFx 7GHbi1CDVfuwZpHVcnyaFIdfsP2JV9Q= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-66-veHIyW2MNwi3LOGTg8kjfw-1; Mon, 30 Mar 2026 05:59:03 -0400 X-MC-Unique: veHIyW2MNwi3LOGTg8kjfw-1 X-Mimecast-MFC-AGG-ID: veHIyW2MNwi3LOGTg8kjfw_1774864742 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-35d9010602bso2703010a91.3 for ; Mon, 30 Mar 2026 02:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1774864742; x=1775469542; 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=ol467QNmt0DQ6eYz8EW6+Q+7C35Qnp9U6TLS9yRvFHw=; b=tBTD0iRjLJBnzdwJdPZyy/EIuJ05FaE3oXM2xMPEfAszmukwNEigUuWoFcoBOQ5tTc PSuM4qFKTb5BsM9gsWPk2CLq98NXJOWNFZqdyDSImk8GHnNQTWrVWdFQdDAjtSiiAzUd DWVInl1JLLcX3ceEcki+bJhTy4AKy3FytgtrzjgiEDLahGIQWTD4C6Ek/ww3D9y63S7t 8iVd+O8CTAJISMOALXjdjrSAkcdTNpqo7KLdmKDIWZSQ+83nXx3k+ZGCdh0DoMCKIInM F04qJqW6YgV2aLiqCeazOjaudI+yqB8u1YBP3SjZ3A1VDiYDL9m6E6O22gFRSmDj0yjT F7XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774864742; x=1775469542; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ol467QNmt0DQ6eYz8EW6+Q+7C35Qnp9U6TLS9yRvFHw=; b=KGZtollmmpVo9EYYRQ7P1XS/yPEG+QsvLwmMLT5t3MkZ3Bsokus47YQ20+lzRR6DxJ JKho9u82Rdil87gYKP9+3Vr3d/RUZNBHj1Jwg0kqlCut+evwLXugodc93Rot9Jm0RJF6 dZdoVzzuBh0Acp/U2RfvdmEzHO1dVp/4lxu9Cepm2ktpJoPB2QH0Mh8mkuWtPeWUelx8 M7eHkauvOWdt8S8NxWcnVnEdAEe0/5biPCGSL9MCDXzBFW4VvXBoTT3iMo/i6RrOVL6V GoQqsLIJGi4JEsiiYjH97pP/orO+RPH5fq9dWqbjGDaZazbFhM8iwXYeWPZdsATLvvWh 1KOw== X-Forwarded-Encrypted: i=1; AJvYcCXNVeGcsl9PW6kH5q5y9tg8qIUhK9W0ihNRV9s40COl0q5npcmongdc6uTpyQvfyCmLSOVCqQyF7G2UO5E=@vger.kernel.org X-Gm-Message-State: AOJu0Yxyjb7tuZmEBdvrMDiYaGPk5PyCePogCN/VSfIJZPfL7os/p7E2 vegqYodMmZxj0HH1FLlXFiIQ1h/421ti3H3fHhR9C3UKQ7KOQHpuvbj4AMg3T3fYG0RPOFM4INz psbfYjljZqRw55ZNJugFFGRiYqI103jxVd/jFTQln7V6d1FGjyqwsZPQCMPkdSdmbQg== X-Gm-Gg: ATEYQzw8J/FvXkvj2vQw6H0BMv3qecNYjtmbrMdXzdM8pknlXikUkNOAb1KjN1Zuejl l8arUxS0YZvU7hae6v7EMpyCkTZu5nWRXThQvGkSN6jypmhIlc0/eG5vTaRCbbaC0MfvcNxa+vc LWZWDXOn5iGdncOe+hPaouEwQUW6FsYnyMXu7qOTnoDxuXlJEgBTH1F7Rb3kDmo/kZUJ5+vVvGX lDTUnfVKQI9k1mfm9oF5rI1YdUhvpueYD3ghUOqjaHWkBBbmxtj3yhFJUx1/MlAc57+0QLsVfi2 pZFaM40lx7u5G+gbFjHtPhgaLPqXYWIaX+eusgsixsM0nHlFjYw8do2JVXVQoP3m15Pc7k0KDIg s5Jf04gBZsbiGEKs8sQ== X-Received: by 2002:a17:90a:2ca4:b0:35c:30a8:33a with SMTP id 98e67ed59e1d1-35c30a80a1amr6873867a91.12.1774864740233; Mon, 30 Mar 2026 02:59:00 -0700 (PDT) X-Received: by 2002:a17:90a:2ca4:b0:35c:30a8:33a with SMTP id 98e67ed59e1d1-35c30a80a1amr6873768a91.12.1774864736640; Mon, 30 Mar 2026 02:58:56 -0700 (PDT) Received: from redhat.com ([209.132.188.88]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35d908216ddsm3613964a91.5.2026.03.30.02.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 02:58:56 -0700 (PDT) Date: Mon, 30 Mar 2026 17:58:53 +0800 From: Li Wang To: akpm@linux-foundation.org, rppt@kernel.org, david@kernel.org, ljs@kernel.org, Liam.Howlett@oracle.com, vbabka@kernel.org, surenb@google.com, mhocko@suse.com, shuah@kernel.org Cc: aubaker@redhat.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v3] selftests/mm: skip hugetlb_dio tests when DIO alignment is incompatible Message-ID: References: <20260330053915.75442-1-liwang@redhat.com> 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: <20260330053915.75442-1-liwang@redhat.com> Reply to Sashiko: > + if (start_off % dio_align != 0 || writesize % dio_align != 0) { > + ksft_test_result_skip("DIO alignment (%u) incompatible with " > + "buf offset %u and writesize %zu\n", > + dio_align, start_off, writesize); > + return; > + } > Does start_off represent the memory buffer alignment rather than the file > offset alignment? > If it represents the memory buffer offset within the page-aligned hugepage, > should it be validated against stx_dio_mem_align instead of > stx_dio_offset_align? Hmm, I don't believe this unless you give me strong evidence here! After looking though Filesystems for handling the direct IO process, I just found that Btrfs does the buffer-address alignment check but it uses the dio_offset_align rather than dio_mem_align. And, the check_direct_IO() does not actually distinguish between the two alignments in its fast-path check. It applies dio_offset_align uniformly to pos, length, and buffer address. Also, I tried the reproducer on Btrfs, ext2/3/4, xfs, vfat, ntfs, all get passed with this patch. So I'd keep the patch not check for dio_mem_align. -- Regards, Li Wang