From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12700C43219 for ; Fri, 3 May 2019 21:05:17 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB328206C1 for ; Fri, 3 May 2019 21:05:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="axvWPTpk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB328206C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1hMfMb-0008Tz-SP; Fri, 03 May 2019 17:05:01 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1hMfMa-0008Ts-5g for kernelnewbies@kernelnewbies.org; Fri, 03 May 2019 17:05:00 -0400 Received: by mail-lj1-x244.google.com with SMTP id r72so6329519ljb.9 for ; Fri, 03 May 2019 14:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ipZeWB2XI42Zo2znfuvZvCKaaC62hUAmJSPYqda6dI0=; b=axvWPTpkBaahuYPdTMvRXZUTo26CGHvUVsYM98ot9RUQLoiBLD7LWh83cbaDTHyURR 7rwHejOF2rffTJ/0pKV9paoK4hTXn4ZiHHTLZVHmggn5g6mdBMnYmchlCf8whIfmoRfb /xCaxn6prjGGcHnuyRYt60MQVJoriqslig8aFPIzE3rpVTnMbkY+9Mo5RmIVzSjURHGB JXI5zByg2dL+aoDurvDnDU5uI8zxV2uA2NHsghXnichv+6cSxR5xEF9tWCPaxSiwnT4i JGmwHUTxeWL8buAkecpzDcqsEZP4LOhpoao5ttAOfJ20NUjQd9bqCGmWoMAx782ZBxe5 qN/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ipZeWB2XI42Zo2znfuvZvCKaaC62hUAmJSPYqda6dI0=; b=n4SBigr7NN5H8rQ9LY0+77P6YthScU3qBIs96ZtyUL1uc4J90tC1WBZ/IYohTe1qU+ OTd2/y0UZXUiSUE+e0jv1chFSfMOoMneEAZ04bU6FSd2VD6z33MNR2R9K+dKvc1M95F6 lDcHqOmXoap8ruv6M7EidGrmbRuPDx/ecHrGL5vwc1E1H8qVY6ycPu+2VYwbfZjYvhRF TMFIZoP7693JF56w0g8sdrdPuSwDLwLP1+l2l0vB2B/nchWds9lIAx5FFmvy1aHNzfKo PDx/sFKQhlq2unnZLDE1wOPqiO61d2fbSg+UesEcegH54hYoQ2Z4hjxXeg/VDIQoa9GJ wkcw== X-Gm-Message-State: APjAAAWZFIKvZ5FECHIXHDVqYwrtKNQUOd2Zo3ii+SIKYV0Z+4KDcocW dXaLCQlZirazVMihLwBERP7IpAqIy6vh75OXsTl6PKqoB5E= X-Google-Smtp-Source: APXvYqyDSDXR17JGLypQhMHsEPLQeWp7+Y41wSAeutNoOgXiNpwRgutiHNB7PtKIHoD0stOr+lxxpcxfkYxZuE9LEg0= X-Received: by 2002:a2e:8ecd:: with SMTP id e13mr6410220ljl.30.1556917437701; Fri, 03 May 2019 14:03:57 -0700 (PDT) MIME-Version: 1.0 From: Probir Roy Date: Fri, 3 May 2019 16:03:46 -0500 Message-ID: Subject: radix_tree_next_chunk: redundant search for next slot in hole To: kernelnewbies@kernelnewbies.org, willy@linux.intel.com X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi, I am running Phoronix-fio benchmark on Linux kernel 4.18.0-rc5. I observe that radix_tree_next_chunk search shows some form of a redundant walk while called from radix_tree_for_each_slot iterator. While searching for next slot in a hole, it walks through the same slots over n over. void __rcu **radix_tree_next_chunk(const struct radix_tree_root *root, struct radix_tree_iter *iter, unsigned flags) { ... if ((flags & RADIX_TREE_ITER_TAGGED) ? !tag_get(node, tag, offset) : !child) { ... while (++offset < RADIX_TREE_MAP_SIZE) { void *slot = rcu_dereference_raw( /* redundant slot walk */ node->slots[offset]); if (slot) break; } } ... } Can you please explain such behavior? Any feedback/recommendation about this case is very welcome. -- Probir Roy _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies