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 375103DBD69 for ; Fri, 27 Mar 2026 09:40:04 +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=1774604408; cv=none; b=fEkQYPeBNEUbaYuCxVAoyjlJauNO8xFEN2X0S+hww1hf8sahV8hxm5LKmM6Ol1nsMJxerPJiwnLQv/dZWePsrI4j2LFmhasMk4/H1QAc9MvNcZcI+IpF/gVc0y0rzigU1DL2rUOXsV+lyn0vq4gNrOeQuiyXX5LsqCV3NhduugE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774604408; c=relaxed/simple; bh=Ey8WLB6VdxKp1WgfWUNJnVcybz+km8fh2sjOpkwiTuk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KG6j1IrJ9STkAYFgeIocp3lBlLnmuEYyNmdluaR+463byT4PqMfVTCDbfiLwEPbsteFhyc12cRGG2xoHOCJxBXjtvk1Alzs4P0Bb0LtLrm6G8nTDrrR2yO60wxfXS8yI7cmG/tRqa/556GQZqxIjbNYAmmfaNs6PUSu6ZYncjWY= 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=dtXBeTL1; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=MHvTU5GU; 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="dtXBeTL1"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="MHvTU5GU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774604403; 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=YOdbKfae4JbEA0UPM7uma0S92BFh9dlLyUY4bnqBIVE=; b=dtXBeTL1jqjzWmjn6ZZ8VXcW0Yqx8SPCzBR2LHwzQeMF25PzeiC43I2rurZvGCd7hJITVa SFdvFDCmjZj/2psMDk2X8Kenvxsw7f4SPui0HN/GLnnIeFAmxUVLFRJSJQBbc/AZgsy1rM QrLBXaXH0XdpIGI79SL+9llXDrcjjdM= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-A_E_ViVCOCuGCevsROpOoA-1; Fri, 27 Mar 2026 05:40:01 -0400 X-MC-Unique: A_E_ViVCOCuGCevsROpOoA-1 X-Mimecast-MFC-AGG-ID: A_E_ViVCOCuGCevsROpOoA_1774604401 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2b056b2f0cfso25495525ad.0 for ; Fri, 27 Mar 2026 02:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1774604401; x=1775209201; 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=YOdbKfae4JbEA0UPM7uma0S92BFh9dlLyUY4bnqBIVE=; b=MHvTU5GULh+VTHGoE/keShY7RIOjUQggh6EpVFh592iey55ta63KiMEkVWjbBBfI2v hoTAkFjHNpX3GflrpDpijQMF5UXcp8PmcptyrnHeq5lkrCKS/zjliyjxyMaGVFaSi70S ybgYdPTX/tiG57qT3ajOlzUznnXDQyyIB+dku25JiaIcQr4Tlkm/vq+L+0k7F7TAReh+ pAFL6Y1qRvbGO9Uu1MjVfIkE6qvwmKoc0PEutxzCBQd4tHgIv8sFjk/xbz8xiMP5nZni VR434RiUGumUAoWkNOVkljQyuo7TTHeBzxdxACcbnmZXd1yGvHr1WX0vH29RAKtUlCdO LpwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774604401; x=1775209201; 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=YOdbKfae4JbEA0UPM7uma0S92BFh9dlLyUY4bnqBIVE=; b=EWqkGkJUQXSM6f3FE54u+Siqd3fhUG9MfYKpZnlSbL4DV+5Y9gvFKVBrg0yrJhGUzq Jt3LWKEGjzIgmcCrbMf8jUUQ8o4rDC4G94AqtInh9xE5qNl8k6pDknatfV4KsLgzFEaT Bgdh2FjUto8Km2MObvr+Mg9+SfELCTDQ6m+dXMhY32JW1e0/eoX36wxlxTuIoZeGUOUd 2pBFZZOCLUs6jnQS7Md/QAQq6ogADO6BYukSulBuAurd/aj+HGuLr91mVhx5xWRUX5nW yi/GcwF7naJu+egiYRLZrn0QMoeTqLXIPxaf0KdblBvHfpPNYXiti/f+PXfbi1t5rOL0 D/Cw== X-Forwarded-Encrypted: i=1; AJvYcCV/d1CiUFNVH+YTfogcsSXrLYy4cCHS/dBoq1yMPfKCe+zjxjge/4ZREcqElrH+CoZK0ZWYZoMrs2Ja//0=@vger.kernel.org X-Gm-Message-State: AOJu0YwnsryPC2bEXrFUQQS5fnfAF45U9J0WDuaJFLvEs2A3GKv1zCl3 dXF0GNrCB6b7Qz6V8hkFPI7/6QKLZ+CTidHe5Wdkf/cUnf4Jik6uMMyuLOTwERCUuNINJ/hSRDy cAGvSgX1/bLnhIFiJwPXbkFbCKiUqJsd69yyxXrW6tnY2m/XMlI2zB+Ai3dAYAmPJTw== X-Gm-Gg: ATEYQzz2Xmk7fMPxf4IojsWPZyS6Inrl0vnd+mGCyo0GVpwIhFhg1ZIfaUykL8RTDSe +yXPY5cYHR7A+4JCbY0+6hgUnkg9RoerStVjW93TqSqgVe7IoPVs0f1YHtvNEMkhS/hKovSzDG3 u+5hi3y8WUHiDkFbathUOnQxJhrEEcJdfZRIzFoR60rkElgw07EjExhAUEaFNatbIylFgBsaqJt j4D1g3sxnOnj3g/AbeeJEVwDqNNZXEdWPMQK3NlGbgsTxUNwSQli2nAZAjTBQOIfCIdMTb1aQF1 5ofDre+wgdLm5KSRPhWCD0umqJVcChJp8OZmg1alhsOSQmvFPzOM1JU4zWhMCKbDFKR2sG/14Z7 pnLrwWGJy5gEN8IdaKQ== X-Received: by 2002:a17:903:1b65:b0:2b0:afad:7aad with SMTP id d9443c01a7336-2b0cdd3e3abmr20490345ad.45.1774604400560; Fri, 27 Mar 2026 02:40:00 -0700 (PDT) X-Received: by 2002:a17:903:1b65:b0:2b0:afad:7aad with SMTP id d9443c01a7336-2b0cdd3e3abmr20489965ad.45.1774604400082; Fri, 27 Mar 2026 02:40:00 -0700 (PDT) Received: from redhat.com ([209.132.188.88]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b0bc76b92asm53890105ad.15.2026.03.27.02.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2026 02:39:59 -0700 (PDT) Date: Fri, 27 Mar 2026 17:39:57 +0800 From: Li Wang To: Mike Rapoport , akpm@linux-foundation.org Cc: david@kernel.org, ljs@kernel.org, Liam.Howlett@oracle.com, vbabka@kernel.org, surenb@google.com, mhocko@suse.com, shuah@kernel.org, aubaker@redhat.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests/mm: skip hugetlb_dio tests when DIO alignment is incompatible Message-ID: References: <20260327031243.15903-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: > > --- a/tools/testing/selftests/mm/hugetlb_dio.c > > +++ b/tools/testing/selftests/mm/hugetlb_dio.c > > @@ -20,6 +20,31 @@ > > #include "vm_util.h" > > #include "kselftest.h" > > > > +#ifndef STATX_DIOALIGN > > +#define STATX_DIOALIGN 0x00002000U > > +#endif > > + > > +void check_dio_alignment(size_t pagesize) > > +{ > > + int fd; > > + struct statx stx; > > + unsigned int dio_align = 1; > > + > > + fd = open("/tmp", O_TMPFILE | O_RDWR, 0664); > > + if (fd < 0) > > + ksft_exit_skip("Unable to allocate file: %s\n", strerror(errno)); > > + > > + if (statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &stx) == 0 && > > + (stx.stx_mask & STATX_DIOALIGN)) > > + dio_align = stx.stx_dio_offset_align; > > + > > + close(fd); > > + > > + if ((pagesize / 2) % dio_align != 0) > > + ksft_exit_skip("DIO alignment (%u) incompatible with sub-page offset %lu\n", > > + dio_align, pagesize / 2); > > This also needlessly skips the test with aligned offsets. > > I'd suggest detecting dio_align here, passing it to run_dio_using_hugetlb() > and moving the check that skips a test there. Good point, as the first test case use 'pagesize * 3' is fully aligned and would work fine. But apparently I overlooked that. Also, Sashiko reminder few minor issues, which I would fix them in next version as well. https://sashiko.dev/#/patchset/20260327031243.15903-1-liwang%40redhat.com -- Regards, Li Wang