I think context is really important. Mum's aren't going to wait outside waiting for their 2 year old to invite them in, you know? But at some point, your room becomes a private space.
If mum has moved into your home, then the rules change again. But it's still going to depend on circumstances. If each person has their own private space, it's easier to make those spaces private. Whereas if the living arrangements are cramped... or if your mum is your carer... There are lots of things that are going to be relevant.
It might be a bit confusing to your mum to recognise your room as your private space if the expectation is that she's going to be regularly coming in for household chores, or bringing you food.
So, it may be clearer for everyone if you remove the reasons for mum to come into your space in the first place. If she's folded your laundry for example, negotiate an arrangement where you'll collect it from the laundry yourself.
If you've just asked her to bring you some food, though, I think may e it's a bit harsh to then expect her to hover in the hallway with it waiting for you to grant entry. From her perspective, it's not like you didn't know she was coming in.
Certainly when I've been sharing accommodation, it was always really important to me to keep my room as my private space. But like any boundary, people respect that boundary more easily and with less confusion if we're consistent with it. Which comes down to practice.
Now that it's come up? Mum might (she might not!) appreciate a bit of communication about what's appropriate and what's not. Communication is really helpful when sharing accommodation with anyone. It's not about feeling guilty for 'being a bad daughter', it's just about helping everyone be on the same page, and achieving that through healthy communication, rather than waiting for the moment tension spills over.