The crankcase vent filter should be replaced regularly, according to the manufacturer's recommendations. A clogged or dirty crankcase vent filter can cause the engine to run rough, stall, or even fail to start. It can also lead to premature wear and tear on the engine.
If you are not sure if your Yanmar diesel engine has a crankcase vent filter, you can check the engine's owner's manual or consult with a qualified mechanic.